算什么? 子查询。今天刚好有一个例子:
http://expert.csdn.net/Expert/topic/2665/2665923.xml?temp=.4332392

解决方案 »

  1.   

    --如果楼主要练的话,参考我的一些贴子:拼音处理
    http://expert.csdn.net/Expert/topic/2361/2361465.xml?temp=.2815821树形数据的处理
    http://expert.csdn.net/Expert/topic/2285/2285830.xml?temp=.7908594查询第X页,每页Y条记录
    http://expert.csdn.net/Expert/topic/2365/2365596.xml?temp=.8605615化解字符串不能超过8000的方法
    http://expert.csdn.net/Expert/topic/2303/2303308.xml?temp=.8503076
      

  2.   

    子查詢.
    其實不用子查詢.用聯接更簡單,更快
    select a.col1,b.col2 
    from table1 a
    left join table2 b 
    on b.col1 = a.col1
      

  3.   

    我看是联接,和下面的语句是一样的;
    select a.col1,b.col2
    from table1 a left join table2 b on a.col1=b.col1
      

  4.   

    to: sunrisehy2003(黎明) 
    从效率上说没错,只不过,在实际处理时,有时需要用:select a.col1, (select b.col2 from table2 b where b.col1 = a.col1) col2 from table1 a这种写法而已.
      

  5.   

    select a.col1,b.col2
    from table1 a inner join table2 b on a.col1=b.col1
      

  6.   

    子查询,不过性能没有left join 优化select a.x ,(select b.y from b where a.x =b.x) y from a先对a 表进行查询遍历(类似游标)在和第一条数据参照b表的条件进行筛选非特殊情况不建议使用
      

  7.   

    我觉得这种句子是不是可以实现外联接呀?
    我认为select a.col1, (select b.col2 from table2 b where b.col1 = a.col1) col2 from table1 a返回table1的所有行
    而select a.col1,b.col2
    from table1 a left join table2 b on a.col1=b.col1返回a,b的公共行???
      

  8.   

    但好象比外联接更加灵活。特别是多表复杂查询中,是left join/right join/full join无法比拟的