2. 增删改查语句

2017-07-28  本文已影响0人  A梦啊

#插入数据# 

>insert into msg

>(id,title,name,content)

>values

>(1,"问好","张三","初来乍到,请多指教。");

>insert into msg

>(id,title,name,content)

>values

>(1,"又来了","李四","能当老大吗?"),

>(3,"3标题","刘备","雌雄双剑"),

>(4,"4标题","关于","青龙偃月刀"),

>(5,"5标题","张飞","丈八蛇矛");

#修改数据#

>update msg

>set

>id=2,

>content="偏要当老大"

>where

>name="李四";

#删除数据#

>delete from msg

>where id=2;

#查询表格数据#

①查询整张表

>select * from msg;

②查询部分行或列

>select name,content

>from msg

>where id>2;

上一篇 下一篇

猜你喜欢

热点阅读