mssql where in 按照 in 中的进行排序

Select * FROM NodeTable Where(idNode IN(2247,4,82538,71994,2245)) ORDER BY CHARINDEX(',' + CONVERT(nvarchar, idNode) + ',', ',' + CONVERT(nvarchar, Replace('2247,4,82538,71994,2245', ' ', '')) + ',')

猜你喜欢

转载自blog.csdn.net/megoodtoo/article/details/80665660