select * from 成绩表 a where 总分 >= (select 分数线 from 县区表 b where a.县区代号 = b.县区代号)
select * from 成绩表 a ,县区表 b where a.县区代号 = b.县区代号 and a.总分 > b.分数线
很简单用别名就可以了如: select a.id,a.score from table1 as a ,table2 as b where a.县区代号=b.县区代号 and a.总分=b.分数线 (注意这样可能要出错,所以建表的时候把分数线换名为总分
SELECT A.准考证号,A.总分,B.县区名称 FROM 成绩表 A LEFT OUTER JOIN 县区表 B ON A.县区代号=B.县区代号 AND A.总分>=B.分数线
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.总分>=分数线)
select * from 成绩表 a where 总分 >= (select 分数线 from 县区表 b where a.县区代号 = b.县区代号)
select * from 成绩表 a ,县区表 b where a.县区代号 = b.县区代号 and a.总分 > b.分数线
select * from 成绩表 left join 县区表 on 成绩表.县区代号 = 县区表.县区代号 and 成绩表.总分 >= 县区表.分数线
from 成绩表 a ,县区表 b
where a.县区代号 = b.县区代号 and a.总分 > b.分数线
select a.id,a.score from table1 as a ,table2 as b where a.县区代号=b.县区代号
and a.总分=b.分数线
(注意这样可能要出错,所以建表的时候把分数线换名为总分
ON A.县区代号=B.县区代号 AND A.总分>=B.分数线
ON A.县区代号=B.县区代号 AND A.总分>=B.分数线select * from table1 a where exists(select 1 from table2 where 县区代号=a.县区代号 and a.总分>=分数线)
from 成绩表 a ,县区表 b
where a.县区代号 = b.县区代号 and a.总分 > b.分数线
from 成绩表
left join 县区表
on 成绩表.县区代号 = 县区表.县区代号 and 成绩表.总分 >= 县区表.分数线
帮我看看,如果不能帮忙up.