SELECT
*
FROM
users
where
email = 'email@example.com'
or
address = '123456'
我如何获得第一个条件的结果email = 'email@example.com'
冷杉?
答案 0 :(得分:3)
是的,您可以使用CASE
表达式:
SELECT
*
FROM
users
where
email = 'email@example.com'
or
address = '123456'
order by
case
when email = 'email@example.com' then 1
else 2
end
答案 1 :(得分:0)
python filename.py