时间:2021-07-01 10:21:17 帮助过:34人阅读
SELECT:
select * from table
select 列名 from table
select DISTINCT 列名 from table
INSERT:
insert into table values(‘‘,‘‘,‘‘,‘‘...)
insert into table(列,列..) values(‘‘,‘‘,..)
UPDATE:
update table set 列=新值 where 列=某值
DELETE:
delete from table where 列=某值
delete * from table (删除数据,不破坏表结构,属性,索引)
TOP:
select top 2 * from table
select * from table limit 2
select top 50 percent * from table (选取50%的记录)
LIKE:
select * from table where 列 NOT LIKE ‘%lon%‘;
通配符:
%:替代一个或多个字符
_:一个字符
[ char list]:字符列中任一单个字符
[^char list] 或者[!charlist] :不在字符列中的任一单个字符
select * from table where column like ‘[ALN]%‘; //以A / L / N开头的
IN:
select * from table where column IN (value1,value2,...)
Alias(别名):
select p.Firstname from persons AS p where p.Lastname=‘John‘
sql基本
标签:多个 update select ^c sel 索引 删除 from har