select top 10 wid, stuff(
(select ','+convert(varchar(25), rwid) from CombineBuying as t2 where t2.wid = t1.wid FOR XML PATH('')), 1, 1, ''
) as rwids from CombineBuying as t1 where t1.wid = '1003376649' group by wid
结果:
| wid | rwid |
| 1003376649 | 214474,187698,188549,259662,187701,209419,301721,187678,160848,212992,187248 |
SQL查询:获取指定wid下的前10个wid
本文展示了如何使用SQL查询语句,从CombineBuying表中筛选出指定wid(1003376649)下的前10个wid,并将它们以逗号分隔的形式展示。
767

被折叠的 条评论
为什么被折叠?



