卓越飞翔博客卓越飞翔博客

卓越飞翔 - 您值得收藏的技术分享站
技术文章64334本站已运行4115

SQL多种条件查询方法集合

查询值等同于2.50的行

select column1,column2 from tables where column1=2.50;

查询字符等同于‘fuses’的行

select column1,column2 from tables where column1='fuses';

查询值小于10的行

select column1,column2 from tables where column1<10;

查询值不等同于1003的行

select column1,column2 from tables where column1<>1003;

查询值不等于1003的行

select column1,column2 from tables where column1!=1003;

查询值5-10的行

select column1,column2 from tables where column1between 5 and 10;

查询某列为觑的行

select column1,column2 from tables where column1 is null;

查询某列于=1003且某列于<=10的值

select column1,column2,c3 from tables where column1=1003 and column2<=10;

查询某列=1003或某列于<=10的值

select column1,column2,c3 from tables where column1=1003 or column2<=10;

查询某列=1003或某列=1002且某列=10的值

select column1,column2,c3 from tables where column1=1003 or column2=1002 adn c3>=10;

查询某列=1003或某列于=1002,某列于>=10的值

select column1,column2,c3 from tables (where column1=1003 or column2=1002 )adn c3>=10;

查询多列从某表里的某列于就是10021003的所有行,按照某列于排序

select column1,column2 from tables where column in (1002,1003) order by column;

查询多列从某表里的某列于不是10021003所有行,按照某 列排序

select column1,column2 from tables where column not in (1002,1003) order by column;

卓越飞翔博客
上一篇: 数据库SQL几种排序方法聚合
下一篇: Python抖音官方接口分享
留言与评论(共有 0 条评论)
   
验证码:
隐藏边栏