开发者

If condition in select query

select email from mailing list

This is the query i want to use if condition. I have a column in mailing list as 开发者_StackOverflow社区unsub. If this unsub is true the email should null in the selected result otherwise the email will be the selected result


select case unsub when true then null else email end as email,....
from ...

see the docs for more examples.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜