当前位置: 代码迷 >> Sql Server >> 用连接还是分开好啊该怎么处理
  详细解决方案

用连接还是分开好啊该怎么处理

热度:43   发布时间:2016-04-27 21:14:03.0
用连接还是分开好啊
请问这两个方式哪一个更好啊
1
sql= "select   t2.city   from   povince   as   t1   inner   join   city   as   t2   on   t1.info_id   =   t2.type_id   where   t1.province   =   ' "&province& " ' "

2
pv   =   conn.Execute( "select   info_id   from   povince   where   province   =   ' "&province& " ' ")(0)
sql   =   "select   city   from   city   where   type_id   =   "&pv

------解决方案--------------------
1好,只須查詢一次數據庫,2要兩次PIO高些

------解决方案--------------------
1好
  相关解决方案