一个比较难的Sql语句 select a.* from table1 a,(select rybh,tjxxid=max(tjxxid) from table1 group by rybh)bwhere a.rybh=b.rybh and a.tjxxid=b.tjxxid 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select t.* from t,(select rybh,max(tjxxid) tjxxid from t group by rybh) awhere t.rybh=a.rybh and t.tjxxid=a.tjxxid --或者这样(这也是楼主自己写的那个语句的意思),但这样的效率差很多.select *from table1 awhere tjxxid=(select tjxxid=max(tjxxid) from table1 where rybh=a.rybh) SELECT a.*from tb a,(select rybh,max(tjxxid) as tjxxid from tb group by rybh) b where a.rybh=b.rybh and a.tjxxid=b.tjxxid 行转列的问题 求助 三表左连接 sql如何取得本地时间而不是取得sql服务器的时间(急!!!) 一行数据从一个表转移到另一个表,SQL语句如何写? ~~~新手问题~~关于自动编号 菜鸟问题 创建数据库代码 请教:如何使sql server在每天指定的时间执行一些sql语句操作 请教大家如果编写SP实现这样的功能??? 一个FOXPRO的问题 怎样删除重复的记录? 关于事务处理得问题,请高手做答。。。
where t.rybh=a.rybh and t.tjxxid=a.tjxxid
from table1 a
where tjxxid=(select tjxxid=max(tjxxid) from table1 where rybh=a.rybh)
from
tb a,(select rybh,max(tjxxid) as tjxxid from tb group by rybh) b
where a.rybh=b.rybh and a.tjxxid=b.tjxxid