简体   繁体   中英

MYSQL - what is the difference between NULL and (null)

I had trouble googling this because of the parentheses on the last null.

What is the difference between NULL and (null) for mysql? I think the NULL is entered for a row when I don't specify a value when I create the row. But what creates the entry (null)?

I see the (null) in an entry for a row in mysql. Looks like this

mysql> select * from users;

+--------+-----------+------------+----------+
|id      | field1    | field2     |  field3  |
+--------+-----------+------------+----------+
| 0      | (null)    | (null)     |     NULL |

I'm using mysql5. The (null) shows up after the user edits the row by inputting some data, and RubyOnRails stores the data in mysql. I'm trying to figure out what the user could be inputting (or not inputting) that would create the (null).

NULL essentially means "nothing". As in, you do not have a value present.

As for "(null)", that does not exist in MySQL. Please elaborate if possible and I will edit my answer.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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