[向晴天提问^_^]多条件排序还是那个问题SQL codeif object_id(t1) is not nulldrop table t1gocreate ta
[向晴天提问^_^]多条件排序 还是那个问题
SQL code
if object_id('t1') is not nulldrop table t1gocreate table t1(id int,a int,b int)insert t1select 1, 6, 2009 union allselect 2, 2, 2008 union allselect 3, 0, 2011 union allselect 4, 3, 2011 union allselect 5, 5, 2012 union allselect 6, 4, 2013godrop table t1
回复已查看,多谢讲解,另外还是这个题目 (1) select * from t1 order 1 是按照第一列排序吧? (2) 那么select * from t1 order by case when a=5 then 1 else 0 end 这是将a=5是排到后面?难道不是当a=5时,按第一列排序? (3) 那么select a,b from c order by case when a=5 then 1800 else b end