1. 程式人生 > >衣服尺碼自定義排序sql

衣服尺碼自定義排序sql

轉載請註明出處 

select     SizeCup as Size ,OrderQty  from 

 VW_CM1_SizeBreakdowm where So_NO [email protected]_No and [email protected]_No

 order by 

(case when SizeCup='XXXL' then '0'
	  when SizeCup ='XXS' then '1'
      when SizeCup ='XS' then '2'
      when SizeCup='S' then '3'
      when SizeCup='M' then '4'
	  when SizeCup='L' then '5'
	  when SizeCup='XL' then '6'
	  when SizeCup='XXL' then '7'
	   when SizeCup='XXXL' then '8'
	   --else COMPARE_FLAG
 end) ASC