MySQL 查询浏览器如何输入 NULL?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2784706/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
MySQL Query Browser How do I enter NULL?
提问by rlb.usa
Stupid question:
愚蠢的问题:
In SQL, I know I can do
在 SQL 中,我知道我可以做到
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.
但是,如何NULL
以图形方式进入单元格?我尝试在 MySQL 查询浏览器中输入 'null' 和 'NULL' 和 ''(无/空字符串),但没有成功。
回答by a1ex07
- Switch to edit mode
- Right click on field
- Choose "Clear field content"
- 切换到编辑模式
- 右键单击字段
- 选择“清除字段内容”
回答by Gruber
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.
MySQL Workbench 5.4.42:严重错误,但如果您尝试几次,在编辑模式下右键单击单元格应该会给您选项Set Field(s) to NULL。
DEL, Ctrl+0or similar doesn't work.
DEL, Ctrl+0或类似的不起作用。
In Workbench 6.3 the buggy UI has been fixed. Don't forget to click the Applybutton to actually execute the resulting UPDATE
statement.
在 Workbench 6.3 中,错误的 UI 已得到修复。不要忘记单击Apply按钮以实际执行结果UPDATE
语句。
回答by Peter
Use SHIFT + DEL buttons when clicking on the field that you want to set as NULL.
单击要设置为 NULL 的字段时,请使用 SHIFT + DEL 按钮。
回答by Mitch Dempsey
Google returned:
谷歌返回:
You can right-click on a cell and choose "Clear Field Content" in the popup menu. It will set the cell value to NULL.
您可以右键单击单元格并在弹出菜单中选择“清除字段内容”。它会将单元格值设置为 NULL。
To Add: if you are in edit mode you get a different context menu, make sure you are NOT in edit mode on the cell you want to set to NULL
添加:如果您处于编辑模式,您将获得不同的上下文菜单,请确保您不在要设置为 NULL 的单元格上的编辑模式
回答by Jay
Right Click on the cell and you will find there 'set field(s) to NULL'.
右键单击单元格,您会发现“将字段设置为 NULL”。
回答by peedeeaay
If it helps, there's a workaround (as I'm using Workbench 6.3 and dont see any 'Set Field(s) to NULL'!) ...
如果有帮助,有一个解决方法(因为我使用的是 Workbench 6.3 并且没有看到任何“将字段设置为 NULL”!)...
Copied the SQL statement from the preview, cancel the 'Update' dialog box, manually changed the '' values to NULL and ran that query manually.
从预览中复制 SQL 语句,取消“更新”对话框,手动将 '' 值更改为 NULL 并手动运行该查询。
回答by mp31415
Yet another workaround. Workbench 6.3. Change field to say an empty string and click Apply. In the 'Review the SQL script' dialog change SET field=''
to SET field=NULL
and click Apply.
另一个解决方法。工作台 6.3。将字段更改为空字符串,然后单击应用。在“查看 SQL 脚本”对话框中,更改SET field=''
为SET field=NULL
并单击应用。
回答by Abnormal
if you can't find in MYSQLWORKBENCH ('set field(s) to NULL'.) then just goto phpmyadmin select database find your column cell and click to check box NULL it will be set as NULL.
如果您在 MYSQLWORKBENCH 中找不到('set field(s) to NULL'.)那么只需转到 phpmyadmin 选择数据库找到您的列单元格并单击复选框 NULL 它将被设置为 NULL。