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依据模式找资料
order by 排列资料
select store-name,sales,date from store-information order by sales DESC
本文介绍了使用SQL进行数据查询的基本语法和技术,包括如何利用SELECT语句获取特定字段,DISTINCT关键字去除重复记录,WHERE子句筛选条件,AND与OR运算符组合复杂条件,IN与BETWEEN操作符选取范围值,LIKE模式匹配字符,以及ORDER BY进行结果排序等。
1822

被折叠的 条评论
为什么被折叠?



