SELECT top 3 id,sname,bchara... from pc_bbsmotif
WHERE attribute=10 and Estate='T'
UNION
SELECT top 7 id,sname,bchara... from pc_bbsmotif
WHERE attribute=10 and Estate<>'T'
ORDER BY Estate,etime DESC
如果排序不对,你就改一下Estate为降序就OK了
WHERE attribute=10 and Estate='T'
UNION
SELECT top 7 id,sname,bchara... from pc_bbsmotif
WHERE attribute=10 and Estate<>'T'
ORDER BY Estate,etime DESC
如果排序不对,你就改一下Estate为降序就OK了
WHERE attribute=10 and Estate='T' ORDER BY etime DESC
UNION
SELECT top 7 id,sname,bchara... from pc_bbsmotif
WHERE attribute=10 and Estate<>'T'
ORDER BY etime DESC
from (SELECT top 3 id,sname,bchara... from pc_bbsmotif
WHERE attribute=10 and Estate='T'
ORDER BY etime DESC) A
UNION
select id,sname,bchara...
from (SELECT top 7 id,sname,bchara... from pc_bbsmotif
WHERE attribute=10 and id not in (SELECT top 3 id,sname,bchara... from pc_bbsmotif
WHERE attribute=10 and Estate='T'
ORDER BY etime DESC) C
ORDER BY etime DESC) B
用户名:d12190
密 码:cnnbpc