我在mysql中有这个表
id | chat_id | name | grade | photo | phone
-------------------------------------------
1 | 1344564 | mikel | | |
所以我想在特定条件下在一个代码行中选择所有空字段(成绩,照片,电话)
答案 0 :(得分:0)
您可以在查询中更新成绩,照片和手机,如下所示:
AND (grade = "" OR grade IS NULL)
答案 1 :(得分:0)
您是否要求查询所有其他字段何时为空?像...
SELECT * FROM TABLE
WHERE chat_id="1344564" AND
(grade = "" OR grade IS NULL) AND
(photo = "" OR photo IS NULL) AND
(phone = "" OR phone IS NULL)
答案 2 :(得分:0)
SELECT * FROM exampletable WHERE成绩或照片或电话IN('');