1. 程式人生 > >mql語句中的增刪改查

mql語句中的增刪改查

insert into 表名(列名1,列名2…) values(值1,值2…);

delete from 表名 where 條件表示式

update 表名 set 列名=新值1,列名=新值2 where 條件表示式

查詢

  • 查詢全部

select * from 表名

  • 查詢某一行所有資訊

select 列名 from 表名

  • 按條件查詢

select * from 表名 where 條件表示式1 and 條件表示式2

模糊查詢:
  • 查詢帶有val的資料

select * from 表名 where 列名 like “%val%”

  • 查詢以val開頭的資料

select * from 表名 where 列名 like “val%”

  • 查詢以val結尾的資料

select * from 表名 where 列名 like “%val”