1. 程式人生 > >c#排序sql語句查詢

c#排序sql語句查詢

tab var src lac style div pla nbsp 存儲

排序存儲的效果圖:

技術分享圖片

根據id排序的sql存儲過程:

 DECLARE @type varchar(5000)
select @type=sortable_text from Sortable with(nolock) where sortable_type=NoteType and [key]=00000000
    
    select * from Note with(nolock) where  [key]=00000000
    Order By charindex(,+ convert(varchar,id) +,, (SELECT REPLACE(@type,^,,
)))

c#排序sql語句查詢