|
以下那一个sql statemnet 比较快,(从DB read 出来)
2 个 table
state1(name1,id)
area1(name1,id,state_id)
select * from state1,area1 where state1.id=area1.state_id where state="kuala lumbur";
和
select * from state1 where state1.name1="kuala lumpur"
$temp=row[id]
select * from area1 where state.id="$temp"
那个写法比较好,
我用着mysql+php。
我问因为我打算要从5个table 里select 我要的资料
(shop,state,area,food,foodtype)。
我怕会慢。
[ 本帖最后由 XxX_hunter 于 22-6-2006 06:43 PM 编辑 ] |
|