查询值等于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;
本文转载自:精准像素:11px.cn ,感谢作者分享实用知识