当select后面跟多个表的时候,他们之间一定时候某种关系的,要是没有连接关系可能会导致笛卡尔积形成,降低查询效率,例如这两个查询语句之间的关系。
select a.c_area_cde pro, b.c_area_cde cty, c.c_area_cde cyn
from web_bas_area a, web_bas_area b, web_bas_area c
where a.c_type = '1'
and b.c_type = '2'
and c.c_type = '3'
and a.c_area_cnm = '山东省'
and c.c_area_cnm = '市北区'
and b.c_area_cnm = '青岛市';
Select a.c_Area_Cde Pro, b.c_Area_Cde Cty, c.c_Area_Cde Cyn
From Web_Bas_Area a, Web_Bas_Area b, Web_Bas_Area c
Where a.c_Area_Cde = b.c_Par_Cde
And b.c_Area_Cde = c.c_Par_Cde
And a.c_Type = '1'
And b.c_Type = '2'
And c.c_Type = '3'
And a.c_Area_Cnm = '山东省'
And b.c_Area_Cnm = '青岛市'
And c.c_Area_Cnm = '市北区'