sql学习笔记一 语法

来源:互联网 发布:mac os x 10.6.8软件 编辑:程序博客网 时间:2024/05/17 02:30

select选出表格

select store-name from stroe-information

distinct读取不同资料

select distinct store-name from stroe-information

where选择性抓取资料

select store-name from store-information where sales》1000

and or组合简单条件

select stroe-name from store-information where sales》1000 or(sales《500 and sales》275)

in在不连续的值内抓已知数据

select* from stroe-information where store-name in(‘los’,‘san’)

between在一个范围内抓已知数据

select* from store-informaion where date between ‘jan’ and ‘mar‘

like依据模式找资料

select* from store-information where store-name like ’%AN%‘

order by 排列资料

select store-name,sales,date from store-information order by sales DESC



0 0
原创粉丝点击