标签:查询 sql 基本用法 ike 连续 部分 cts mys 之间
查询的基本语法
select * from 表名;
在select后面列前使用distinct可以消除重复的行
select distinct gender from students;
select * from 表名 where 条件;
select * from students where id>3;
select * from subjects where id<=4;
select * from students where sname!=‘黄蓉‘;
select * from students where isdelete=0;
select * from students where id>3 and gender=0;
select * from students where id<4 or isdelete=0;
select * from students where sname like ‘黄%‘;
select * from students where sname like ‘黄_‘;
select * from students where sname like ‘黄%‘ or sname like ‘%靖%‘;
select * from students where id in(1,3,8);
select * from students where id between 3 and 8;
select * from students where id between 3 and 8 and gender=1;
select * from students where hometown is null;
select * from students where hometown is not null;
select * from students where hometown is not null and gender=0;
标签:查询 sql 基本用法 ike 连续 部分 cts mys 之间
原文地址:https://www.cnblogs.com/webSciprt/p/8908004.html