簡體   English   中英

MYSQL至少對於一列不為null

[英]MYSQL where not null for at least one column

有一個交叉連接表需要捕獲具有特定列的至少一個not null值的行:

where books.id is not null 
or typings.id is not null
or translates.id is not null

是否有任何函數或方法來防止where子句中的重復not null

這樣的事情:
where at_Least_not_Null_One_Of(books.id,typigns.id,translates.id)

使用COALESCE

COALESCE(books.id,typigns.id,translates.id) IS NOT NULL

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM