select * from [user] order by case when a>b and c=false then 1 else 0 end
select * from [user] order by case when a>b and c=false then 1 else 0 end desc
select * from [user] order by case when a> b and c='false' then 0 else 1 end
请教一条sql语句的写法 select * from user 有字段a,b,c,要求优先满足 a> b and c=false 的数据排在前面,剩余的排在后面--- select * from [user] order by (case when a> b and c=false then 1 else 0 end) 接分了
SELECT * FROM user ORDERY BY CASE WHEN a > b and c = 'false' THEN 0 ELSE 1 END
order by case when a> b and c='false' then 0 else 1 end
select * from user
有字段a,b,c,要求优先满足 a> b and c=false 的数据排在前面,剩余的排在后面---
select * from [user] order by (case when a> b and c=false then 1 else 0 end) 接分了
SELECT *
FROM user
ORDERY BY CASE WHEN a > b and c = 'false' THEN 0 ELSE 1 END