select * from dbo.Archives_CM where cmcode='3707850101000009' and HumanCode='03'
union all
select * from dbo.Archives_CM where cmcode='3707850101000009' and HumanCode<>'03' --上面不小心多了个符号。
select * from dbo.Archives_CM where cmcode='3707850101000009' and HumanCode='03'
union all
select * from dbo.Archives_CM where cmcode='3707850101000009' and HumanCode=<>'03'
HumanCode='03' 排序
首先 HumanCode<>'03' 的数据要不要,如果要,只能这样写
select * from dbo.Archives_CM where cmcode='3707850101000009' order by HumanCode desc[asc]
如果不要,那就这样写
select * from dbo.Archives_CM where cmcode='3707850101000009' and HumanCode='03' order by HumanCode desc[asc]
也就是说,不能按照某列的值排序,只能按照表中的某列排序,而不是值