关于多表联合查询,谢谢 select distinct top 5 * from b order by bid desc 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select top 5 * from (select distinct * from 表b) tem order by bid desc?? select top 5 bid,(select [name] from 表a where aid=tem.aid) [name] from (select distinct * from 表b) tem order by bid desc??? select top 5 *from (select distinct * from b) tableorder by bid desc 你只要查B表的数据?和A表没有关系吗?还有你指的不重复是B表所有字段不重复还是只针对aid字段不重复? select b.bid,a.name from a,(select distinct top 5 * from b order by bid desc) b where a.aid=b.bid select top 5 * from 表b a where bid in (select max(bid) from 表b where aid=a.aid )order by aid asc---bid aid12 110 29 3?? select top 5 * from (select distinct * from b) as tableorder by bid desc 表B的aid对应表a中的id即要求满足 b.aid=a.id 关于SQL的insert性能问题,高手请进 如何在fluidsim中通过PC Access和s7-200plc联接 将任一时间如2005-4-24 5:53:59 的datetime 改成2005-4-24 00:00:00 和2005-4-24 23:59:59 两个Datetime Order by 按指定关健字排序1 2005到2000数据库迁移 高手解答 范式到底有什么用? 高分求存储过程写法 急寻 数据库安全方面的英文资料(5000字左右)! 请问这个的SQL怎么写呢? winxp下能不能运行mseq?? 求一简单SQL语句
???
from (select distinct * from b) table
order by bid desc
还有你指的不重复是B表所有字段不重复还是只针对aid字段不重复?
select top 5 * from 表b a
where bid in
(select max(bid) from 表b where aid=a.aid )
order by aid asc
---
bid aid
12 1
10 2
9 3??
order by bid desc