mysql查询为一个列值返回NULL

时间:2022-02-14 07:59:11

I have a mysql database where I want to search for rows that satisfy a certain condition. For that, I'm using the LIKE command, until here, all fine. However, there's a column that is showing its rows values as NULL. This only happens when I SELECT 3 of the 3 float column values. Below I leave pictures of the queries and the shown results.

我有一个mysql数据库,我想搜索满足某个条件的行。为此,我正在使用LIKE命令,直到这里,一切都很好。但是,有一列将其行值显示为NULL。这只发生在我选择3个浮点列值中的3个时。下面我留下查询和显示结果的图片。

CODE:

码:

SELECT `id`, `name`, `priceDose`, `priceHalfDose`, `priceQuarterDose` FROM `weekendmeals` WHERE `name` LIKE "%porco%"

RESULT:

结果:

=================================================================
| id | name                 | priceDose | priceHalfDose |       |
-----------------------------------------------------------------
| 45 | Entrecosto de Porco  |      9.20 |          4.80 | NULL  |   
| 46 | Costelinhas de Porco |     12.30 |          6.90 | NULL  |
| 50 | Costelinhas de Porco |     12.30 |          6.90 | NULL  |
=================================================================

Picture showing the bug

显示错误的图片

CODE:

码:

 SELECT `id`, `name`, `priceDose`, `priceQuarterDose` 
 FROM `weekendmeals` 
 WHERE `name` LIKE "%porco%"

RESULT:

结果:

============================================================
| id | name                 | priceDose | priceQuarterDose |
------------------------------------------------------------
| 45 | Entrecosto de Porco  |      9.20 |          0.00    |   
| 46 | Costelinhas de Porco |     12.30 |          0.00    |
| 50 | Costelinhas de Porco |     12.30 |          0.00    |
============================================================

Result when I remove one of the -float values- column from the search query

从搜索查询中删除其中一个-float values-列时的结果

As you can see, the results are correctly shown when there are only 1 or 2 float columns in the search query, but when I SELECT all the 3 necessary columns of float values, one of them doesn't show, and the values of the rows are NULL.

如您所见,当搜索查询中只有1或2个浮点列时,结果会正确显示,但是当我选择浮点值的所有3个必要列时,其中一个不显示,并且值为行是NULL。

Thanks in advance for any help. If you need extra explanation/data feel free to ask :)

在此先感谢您的帮助。如果您需要额外的解释/数据随时问:)

1 个解决方案

#1


1  

After all it was just a phpmyadmin bug, read the question's comments for more info.

毕竟它只是一个phpmyadmin错误,请阅读问题的评论以获取更多信息。

#1


1  

After all it was just a phpmyadmin bug, read the question's comments for more info.

毕竟它只是一个phpmyadmin错误,请阅读问题的评论以获取更多信息。