SQL 学习日志03
添加表内容:
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 条件表达式
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。