sql server 能按照本身規定的字段順序展現

工做中遇到,須要把sql 查詢的按照指定的順序顯示sql

 

select  plantname,cc_type,all_qty  from VIEW_TEMP_DAY_CVT_CAP a where a.docdate='2019-06-30' and cc_type='成型' and in_ex like '%合計%' 
ORDER BY CHARINDEX(plantname, + '雙源一廠,雙源二廠,自動化車間,防水車間,雙源五廠,射出車間,雙源八廠')

相關文章
相關標籤/搜索