合肥网站建设:left join多表查询
- 2013-12-19 09:43:50 | 新闻来源:叶凡网络 | 访问量:1485
asp 中left join 的使用
sql = "select a.*,b.id as bid,b.name as bname,c.id as cid,c.name as cname "
sql = sql & "from (yf_nav left join a "
sql = sql & "left join yf_nav b on a.id > b.id) "
sql = sql & "left join yf_nav c on a.id < c.id "
sql = sql & "where a.id="&id&" order by b.id desc,c.id asc ,a.id desc"