求助新手 表 tb 有列 a b c d (a,b是主键,d是打酱油的)求当 a和b相同的时候 如果c的数据出现不一样就查出来的怎么写 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select * from tb twhere not exists(select 1 from tb n where t.a=n.a and t.b=n.b and t.c<>n.c) a,b是主键l (联合主键),C的数据和谁比?和主键比?select * from tb where a=b and c!=a 这个问题他没说清楚。如果你a,b为主键,就只能同一行数据a,b跟c比,因为表里面不会让你存在有两行a,b一样的数据。楼主给出测试数据和期待结果吧 我表达错了 我的意思是 a 和a相同的同时 b和b相同 然后要找出会出现c不相同的数据唉语文学不好 表达不清楚 不好意思啊 select * from tb t,tb nwhere t.a=n.a and t.b=n.b and t.c<>n.c) select * from tb twhere not exists(select 1 from tb n where t.a=n.a and t.b=n.b and t.c<>n.c)那就是我一楼的那个意思 又来求一sql 语句了.... 询问存储过程 为什么调用就发生 只有函数和扩展存储过程才能从函数内部执行的错误 一样的语句,相同的数据库,为什么查询结果不同? 100分求一sql语句 sql select into 到临时表顺序问题 求救,jsp显示出现错乱了 数据库问题 有关通过DTS追加行的问题~~急~~ File must be opened exclusively. SQL Server 在sql语句中怎么隐藏 BH_RSI_Repository 这张表不让它在页面中显示出来
where not exists(select 1 from tb n where t.a=n.a and t.b=n.b and t.c<>n.c)
select * from tb where a=b and c!=a
where t.a=n.a and t.b=n.b and t.c<>n.c)
select * from tb t
where not exists(select 1 from tb n where t.a=n.a and t.b=n.b and t.c<>n.c)那就是我一楼的那个意思