请用SQL语句实现:从TestDB数据表中查询出所有月份的发生额都比
101科目相应月份的发生额高的科目。请注意:TestDB中有很多科目,
每个科目都有1-12月份的发生额。
id: 科目代码
months:发生
额月份,
money:发生额
数据库名:JcyAudit
select distinct id from testdb t where not exists
( select t1.*, t2.* from testdb t1 ,testdb t2 where t2.id = 101 and
t1.months = t2.months and t1.id = t.id and t1.money <=
t2.money);
本文介绍了一种使用SQL语句的方法,该方法可以从名为TestDB的数据表中筛选出所有月份的发生额都高于101科目对应月份发生额的科目。

1168

被折叠的 条评论
为什么被折叠?



