SQL 学习日志03
2014-05-08 11:00
267 查看
添加表内容:
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 条件表达式
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 条件表达式
相关文章推荐
- Spark学习-SparkSQL--03-SparkSQL CLI 建表查询出问题
- sql学习日志
- 黑马程序员——黑马学习日志之三 Java基础03
- PL/SQL学习笔记_03_存储函数与存储过程
- angular学习日志03 Hello,World
- SQL 学习日志01
- 我的成长日志20131124学习SQL
- 韩顺平servlet学习笔记03-sql制作大量的数据
- flume学习03-flume收集log4j日志
- SQL学习:mysql数据库备份和使用日志恢复+python调用mysql方法(4)
- SQL 学习日志02
- android学习日志03__ApiDemos学习方法
- Android学习日志12__四大组件03__BroadcastReceiver
- oracle学习 第三章 常用的SQL*PLUS命令 ——03
- SQL个人学习笔记03
- JAVA学习笔记03——Linux系统下安装My'SQL
- #大学#SQL基础学习笔记(03)
- SQL学习日志
- java基础学习日志03
- SQL学习日志