日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關咨詢
選擇下列產品馬上在線溝通
服務時間:8:30-17:00
你可能遇到了下面的問題
關閉右側工具欄

新聞中心

這里有您想知道的互聯(lián)網營銷解決方案
SQL條件語句實例

在SQL語句中,SQL條件語句無疑是使用最廣,最常見的SQL語句之一,下面就將為您介紹幾個使用SQL條件語句,供您學習參考。

----查詢StudentMarks 最大的前三條記錄

select  top 3 StudentID,StudentName,Mark from StudentMarks order by Mark desc

----查詢StudentMarks 的第30~40條記錄

1、從前30條的后面, 取前10條

select top 10 * from StudentMarks where StudentID not in(select top 30 StudentID from StudentMarks)

2、先正序取40條, 再反序取10條

select top 10* from (select top 40* from StudentMarks order by Mark ) a
order by Mark desc

3、、利用臨時表
select top 40 * into #Stm from StudentMarks order by Mark

select top * from #Stm  order by Mark desc

----查詢和London同屬于一個國家的城市的客戶
select distinct * from customers where country in
( select country from customers where city='London')

----查詢和London,Paris同屬于一個國家的城市的客戶
select * from customers where country in
(select country from Customers where City in ('London','Paris'))

----查詢單價大于Dofu的產品名
select ProductName from Products where UnitPrice>
(select UnitPrice from Products where ProductName='Tofu')


本文名稱:SQL條件語句實例
本文來源:http://www.5511xx.com/article/coghdhp.html