Sql server® 2012 t-sql fundamentals



Download 10,93 Mb.
Pdf ko'rish
bet125/443
Sana26.01.2022
Hajmi10,93 Mb.
#411755
1   ...   121   122   123   124   125   126   127   128   ...   443
Bog'liq
BookSQL

 

CHAPTER 2

 

Single-Table Queries



 

 79

You get the following output.

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

1900-01-01 12:30:15.123

Suppose you have a table with a column called tm of a DATETIME data type and you store all val-

ues by using the base date. Again, this could be enforced with a CHECK constraint. To return all rows 

for which the time value is 12:30:15.123, you use the filter WHERE tm = 12:30:15.123’. Because you 

did not specify a date component, SQL Server assumes that the date is the base date when it implic-

itly converts the character string to a DATETIME data type.

If you want to work only with dates or only with times, but the input values you get include both 

date and time components, you need to apply some manipulation on the input values to “zero” the 

irrelevant part. That is, set the time component to midnight if you want to work only with dates, and 

set the date component to the base date if you want to work only with times. I’ll explain how you can 

achieve this shortly, in the “Date and Time Functions” section.




Download 10,93 Mb.

Do'stlaringiz bilan baham:
1   ...   121   122   123   124   125   126   127   128   ...   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