首页 > 数据库技术 > 详细

SQL 学习日志03

时间:2014-05-08 16:35:35      阅读:425      评论:0      收藏:0      [点我收藏+]

添加表内容:

     insert into table_name (字段1,字段2,...) values (值1,值2,....)  

查询表内容:

     select * from table_name 

     select 字段1,字段2 from table_name

     select top 10 * from table_name 

     select * from table_name where 字段=值

     select * from table_name where 字段<>值

     select * from table_name where 字段 like ‘%值%‘

     select * from table_name where 字段 in (值1,值2,...)

     select * from table_name where 字段 in (select 字段 from table_name1)

     select * from table_name where 字段 between 值1 and 值2

     select * from table_name order by 字段 ASC(DESC)

     select * from table_name order by 字段 ASC(DESC) limit 字段=值

     select * from table_name group by 字段

     select sum(字段) from table_name

     select count(字段) from table_name 

     select AVG(字段) from table_name

     select MAX/MIN(字段) from table_name 

更新表内容:

     update table_name set 字段=值 where 条件表达式

     update table_name set 字段1=值1,字段2=值2,....  where 条件表达式

删除表内容:

     delete from table_name where 条件表达式

 

SQL 学习日志03,布布扣,bubuko.com

SQL 学习日志03

原文:http://1392633.blog.51cto.com/1382633/1408266

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!