Stupid question:
In SQL, I know I can do
UPDATE TableA SET MyColumn=NULL
But, how do I enter NULL
into a cell graphically? I tried entering 'null' and 'NULL' and '' (nothing/empty string) into the MySQL Query Browser with no success.
You also can specify the NULL keyword in the VALUES clause to indicate that a column should be assigned a NULL value. The following example inserts values into three columns of the orders table: INSERT INTO orders (orders_num, order_date, customer_num) VALUES (0, NULL, 123);
If you've opened a table and you want to clear an existing value to NULL, click on the value, and press Ctrl + 0 .
For example to insert NULL instead of an empty string using NULLIF() , we could do the following: INSERT INTO `user` (`name`, `job_title`) VALUES ('john', NULLIF('$jobTitle', '')); This would insert NULL in the job_title column when the value of the variable " $jobTitle " matches an empty string.
You can right-click on a cell and choose "Clear Field Content" in the popup menu. It will set the cell value to NULL.
MySQL Workbench 5.4.42: Terribly buggy, but if you try a couple of times, right-clicking the cell while in Edit mode should give you the option Set Field(s) to NULL.
DEL, Ctrl+0 or similar doesn't work.
In Workbench 6.3 the buggy UI has been fixed. Don't forget to click the Apply button to actually execute the resulting UPDATE
statement.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With