Sql server® 2012 t-sql fundamentals


Solutions This section provides solutions to the exercises for this chapter. 1-1



Download 10,93 Mb.
Pdf ko'rish
bet180/443
Sana26.01.2022
Hajmi10,93 Mb.
#411755
1   ...   176   177   178   179   180   181   182   183   ...   443
Bog'liq
BookSQL

Solutions

This section provides solutions to the exercises for this chapter.



1-1

Producing multiple copies of rows can be achieved with a fundamental technique that utilizes a cross 

join. If you need to produce five copies of each employee row, you need to perform a cross join be-

tween the Employees table and a table that has five rows; alternatively, you can perform a cross join 

between Employees and a table that has more than five rows, but filter only five from that table in the 

WHERE clause. The Nums table is very convenient for this purpose. Simply cross Employees and Nums

and filter from Nums as many rows as the number of requested copies (five, in this case). Here’s the 

solution query.

SELECT E.empid, E.firstname, E.lastname, N.n 

FROM HR.Employees AS E 

  CROSS JOIN dbo.Nums AS N 

WHERE N.n <= 5 

ORDER BY n, empid;

www.it-ebooks.info




Download 10,93 Mb.

Do'stlaringiz bilan baham:
1   ...   176   177   178   179   180   181   182   183   ...   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