• 微信号:Zh-y9213
您当前的位置:爱资源分享网 > > 网站源码 > 网站制作

SQL多种条件查询方法集合

栏目:网站制作时间:2021-07-09 12:45阅读数:63人阅读

查询值等于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;



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

本站所有文章、数据、图片均来自互联网,一切版权均归源网站或源作者所有。

如果侵犯了你的权益请来信告知我们删除。邮箱:737597453@qq.com