--字段去重--distinct
select distinct sname from student
-- 部分列
select name,age from person;
-- 指定列名---列的简单运算和别名
select name as '名字', age as '年龄' from person;
select name,(english+chinese) as total_score from user
-- 条件查询
select * from person where phone='13545269582';
select * from person where phone !='13545269582';
select * from person where age >= 24;
select * from person where age >= 24 and name=‘lijia’;
-- between(包含-闭区间)
select * from person where age between 22 and 25;
-- like模糊 _单字符 %所有
-- 以朱开头
select * from person where name like '朱%';
-- 以1结尾
select * from person where name like '%1';
-- 所有带朱字的人
select * from person where name like '%朱%';
-- in 其中一个
select * from person where phone in (12645825963,12645825967);
-- 判断 空 is null not null
select * from person where name is null;
select * from person where name is not null;
标签:name,--,age,查询,person,单表,where,select From: https://www.cnblogs.com/vip01/p/17056172.html