简体   繁体   English

MySQL空只选中一个列

[英]Mysql empty only one selected column

In mysql I have a table called requests. 在mysql中,我有一个称为请求的表。 The table looking like this 桌子看起来像这样

 ==================
 |    requests      |
  ==================
  +  id             +
  +  date           +
  +  firstname      +
  +  lastname       +
  +  request_number +
  +  status         +
  +++++++++++++++++++

Now here I want that on single button click I will delete all the values stored inside request_number and the request_number column will be only empty.It will not delete the column name 现在在这里我希望单击一个按钮将删除存储在request_number所有值,并且request_number列将仅为空,而不会删除列名

If you need to empty request_number cells in entire table 如果您需要在整个表格中清空request_number个单元格

UPDATE requests SET request_number = NULL;

If you need to empty request_number for records having specif condition 如果需要清空具有特定条件的记录的request_number

UPDATE requests SET request_number = NULL where <your condition>;

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

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