17. Updating and deleting data
Updated: Update table Set columns = ' value ' where ...
Mysql> UpdatePw_priceSetPrice=10000 whereUid=6; Query OK,1Row affected (0.03sec) Rows matched:1Changed:1Warnings:0MySQL> Select * fromPw_price;+-----+-------+------------+|Uid|Price|First_Name|+-----+-------+------------+| 1 | - |Wang|| 2 | + |Zhang|| 3 | - |Li|| 4 | the |Weizhi|| 5 | the |Cai|| 6 | 10000 |eu-|+-----+-------+------------+6Rowsinch Set(0.00Sec
Mysql> UpdatePw_priceSetFirst_Name="Guo6"whereUid= 6; Query OK,1Row affected (0.03sec) Rows matched:1Changed:1Warnings:0MySQL> Select * fromPw_price;+-----+-------+------------+|Uid|Price|First_Name|+-----+-------+------------+| 1 | - |Wang|| 2 | + |Zhang|| 3 | - |Li|| 4 | the |Weizhi|| 5 | the |Cai|| 6 | 10000 |Guo6|+-----+-------+------------+6Rowsinch Set(0.00Sec
Delete data
Delete from table where ...
Mysql> Select * fromPw_price;+-----+-------+------------+|Uid|Price|First_Name|+-----+-------+------------+| 1 | - |Wang|| 2 | + |Zhang|| 3 | - |Li|| 4 | the |Weizhi|| 5 | the |Cai|| 6 | 10000 |Guo6|+-----+-------+------------+6Rowsinch Set(0.00sec) MySQL> Delete fromPw_pricewhereUid>=6; Query OK,1Row affected (0.03sec) MySQL> Select * fromPw_price;+-----+-------+------------+|Uid|Price|First_Name|+-----+-------+------------+| 1 | - |Wang|| 2 | + |Zhang|| 3 | - |Li|| 4 | the |Weizhi|| 5 | the |Cai|+-----+-------+------------+5Rowsinch Set(0.00Sec
SQL Basics--mysql 5 (10)