数据唯一性…… select distinct a.id from a,b where a.id=b.aid 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select distinct id from a select * from a left join (select * from b b1 where not exists(select 1 from b b2 where b1.aid=b2.aid and b1.id<b2.id))b3on a.id=b3.aid to 楼上的两位:这样的话只能有id,我同时需要其它数据啊。如果select distinct a.id as tmpid,* from a,b where a.id=b.aid这样id还是不唯一。 to CrazyFor(太阳下山明朝依旧爬上来):谢谢你,如果B中没有B.aid=A.id就不需显示A中的数据,如何把这部分的数据给剔除,谢谢!! select * from a join (select * from b b1 where not exists(select 1 from b b2 where b1.aid=b2.aid and b1.id<b2.id))b3on a.id=b3.aidleft去掉即可 mssql2005 数据导入至 mssql2005问题 NVARCHAR的例子 請教兩個問題,謝謝! 分组统计问题 求一条查询语句 一个稍复杂的sql语句的问题。(标题加长。。。) 公司网站被恶意代码植入---求助 数据库的设计问题 我的sql语句怎么写呀??加急!!! 简单问题!!!在线等 请教如何设计这个触发器?在线等待。。。 请教:使用TRIGGER时,Update Table能跨Database吗?
on a.id=b3.aid
这样id还是不唯一。
on a.id=b3.aidleft去掉即可