MySql updating column that is null -
i trying update column value has null value.
table:
+------------+-----------+-------+ | product_no | name | price | +------------+-----------+-------+ | 1 | cheese | 9.99 | | null | meat | 17.00 | | 2 | pepperoni | null | +------------+-----------+-------+ update:
update products set product_no = 6 product_no = null; output:
query ok, 0 rows affected (0.00 sec) rows matched: 0 changed: 0 warnings: 0 table definition:
+------------+---------------+------+-----+---------+-------+ | field | type | null | key | default | | +------------+---------------+------+-----+---------+-------+ | product_no | int(11) | yes | | null | | | name | varchar(255) | yes | | null | | | price | decimal(10,2) | yes | | null | | +------------+---------------+------+-----+---------+-------+ why not updating 6?
try this:
update products set product_no = 6 product_no null;
Comments
Post a Comment