日本综合一区二区|亚洲中文天堂综合|日韩欧美自拍一区|男女精品天堂一区|欧美自拍第6页亚洲成人精品一区|亚洲黄色天堂一区二区成人|超碰91偷拍第一页|日韩av夜夜嗨中文字幕|久久蜜综合视频官网|精美人妻一区二区三区

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

新聞中心

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

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

----查詢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的產(chǎn)品名
select ProductName from Products where UnitPrice>
(select UnitPrice from Products where ProductName='Tofu')


分享題目:SQL條件語句實例
文章路徑:http://www.dlmjj.cn/article/coghdhp.html