Sql server® 2012 t-sql fundamentals



Download 10,93 Mb.
Pdf ko'rish
bet89/443
Sana26.01.2022
Hajmi10,93 Mb.
#411755
1   ...   85   86   87   88   89   90   91   92   ...   443
Bog'liq
BookSQL

LISTING 2-6

  Query Demonstrating TOP with Unique ORDER BY List

SELECT TOP (5) orderid, orderdate, custid, empid 

FROM Sales.Orders 

ORDER BY orderdate DESC, orderid DESC;

This query returns the following output.

orderid     orderdate                       custid      empid 

----------- -----------------------------   ----------- ----------- 

11077       2008-05-06 00:00:00.000         65          1 

11076       2008-05-06 00:00:00.000         9           4 

11075       2008-05-06 00:00:00.000         68          8 

11074       2008-05-06 00:00:00.000         73          7 

11073       2008-05-05 00:00:00.000         58          2 

 

(5 row(s) affected)



If you examine the results of the queries from Listing 2-5 and Listing 2-6, you’ll notice that they 

seem to be the same. The important difference is that the result shown in the query output for Listing 

2-5 is one of several possible valid results for this query, whereas the result shown in the query output 

for Listing 2-6 is the only possible valid result.

www.it-ebooks.info




Download 10,93 Mb.

Do'stlaringiz bilan baham:
1   ...   85   86   87   88   89   90   91   92   ...   443




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish