分享网正式开通,我们为大家提供免费资源,欢迎大家踊跃投稿!

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;



资源均来自第三方,谨慎下载,前往第三方网站下载


爱资源分享网 , 版权所有丨本站资源仅限于学习研究,严禁从事商业或者非法活动!丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:SQL多种条件查询方法集合
喜欢 ()分享 (0)