简体   繁体   English

如何在mysql中选择一行中的第一个空列

[英]How to select the first null column in a row in mysql

I am a MySQL newbie. 我是MySQL新手。 Consider this is how a row looks on a table in my database 考虑这是我数据库中的表上的行的外观

id q1 q2 q3 q4 q5

and the values for each of these columns is as follows 每个列的值如下

01 abc null null null

which means that the 3rd column (q2) is null 这意味着第三列(q2)为空

I would like to select this null column using MySQL. 我想使用MySQL选择此空列。 In this example, I know that q3 is null, however, when this code is running on my website, I will have to find out the null column and will have to insert values into that. 在此示例中,我知道q3为null,但是,当此代码在我的网站上运行时,我将不得不找出null列,并必须在其中插入值。 Can anyone help me here? 有人能帮我一下吗?

Thanks in advance. 提前致谢。

从mytable中选择*,其中column =空限制1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM