标签:nbsp 条件查询 amp cap tin false 去重 ssi 条件
1.
select * from 表名
select distinct 查询列表 from 表名 //去重查询
2. 条件查询
select 查询列表 from 表名 where 筛选条件;
select * from employees where salary>12000;
select last_name, department_id from emplyees where department_id!=90;
select last_name,salary,commission_pct from emplyees where salary>=10000 and salary<=20000;
select * from employees where last_name like ‘%a%‘;
select * from employees where last_name like ‘___e_a%‘;
select * from employees where last_name like ‘_\_%‘; 第2个字符为_时,需要作用转义符\。
select * from employees where last_name like ‘_$_%‘ escape ‘$‘;
按条件表达式筛选:
条件运算符:> < = != <> >= <=
按逻辑表达式筛选:
作用:用于连接条件表达式
&&和and:两个条件都为true,结果为true, 反之为false
||和or:
逻辑运算符: && || ! and or not
模糊查询:
like(和通配符搭配使用 % 0个或任意多个字符,_任意单个字符) between and in is null is not null
标签:nbsp 条件查询 amp cap tin false 去重 ssi 条件
原文地址:https://www.cnblogs.com/misswjr/p/9442422.html