你查一查SQL中连接查询的语法。

解决方案 »

  1.   

    select * from 成绩表 a where 总分 >= (select 分数线 from 县区表 b where a.县区代号 = b.县区代号)
      

  2.   

    select *
    from 成绩表 a ,县区表 b
    where a.县区代号 = b.县区代号 and a.总分 > b.分数线
      

  3.   

    很简单用别名就可以了如:
    select a.id,a.score from table1 as a ,table2 as b where a.县区代号=b.县区代号
    and a.总分=b.分数线
    (注意这样可能要出错,所以建表的时候把分数线换名为总分
      

  4.   

    SELECT A.准考证号,A.总分,B.县区名称 FROM 成绩表 A LEFT OUTER JOIN 县区表 B
    ON A.县区代号=B.县区代号 AND A.总分>=B.分数线
      

  5.   

    SELECT A.准考证号,A.总分,B.县区名称 FROM 成绩表 A LEFT JOIN 县区表 B
    ON A.县区代号=B.县区代号 AND A.总分>=B.分数线select * from table1 a where exists(select 1 from table2 where 县区代号=a.县区代号 and a.总分>=分数线)
      

  6.   

    select * from 成绩表 a where 总分 >= (select 分数线 from 县区表 b where a.县区代号 = b.县区代号)
      

  7.   

    select *
    from 成绩表 a ,县区表 b
    where a.县区代号 = b.县区代号 and a.总分 > b.分数线
      

  8.   

    select *
    from 成绩表
    left join 县区表
    on 成绩表.县区代号 = 县区表.县区代号 and 成绩表.总分 >= 县区表.分数线
      

  9.   

    http://expert.csdn.net/Expert/topic/1895/1895969.xml?temp=.6427118
    帮我看看,如果不能帮忙up.