Sql server® 2012 t-sql fundamentals



Download 10,93 Mb.
Pdf ko'rish
bet94/443
Sana26.01.2022
Hajmi10,93 Mb.
#411755
1   ...   90   91   92   93   94   95   96   97   ...   443
Bog'liq
BookSQL

Predicates and Operators

T-SQL has language elements in which predicates can be specified—for example, query filters such as 



WHERE and HAVINGCHECK constraints, and others. Remember that predicates are logical expres-

sions that evaluate to TRUEFALSE, or UNKNOWN. You can combine predicates by using logical opera-

tors such as AND and OR. You can also involve other types of operators, such as comparison operators, 

in your expressions.

Examples of predicates supported by T-SQL include INBETWEEN, and LIKE. The IN predicate al-

lows you to check whether a value, or scalar expression, is equal to at least one of the elements in a 

set. For example, the following query returns orders in which the order ID is equal to 10248, 10249, or 

10250.


SELECT orderid, empid, orderdate 

FROM Sales.Orders 

WHERE orderid IN(10248, 10249, 10250);

The BETWEEN predicate allows you to check whether a value is in a specified range, inclusive of 

the two specified boundary values. For example, the following query returns all orders in the inclusive 

range 10300 through 10310.

SELECT orderid, empid, orderdate 

FROM Sales.Orders 

WHERE orderid BETWEEN 10300 AND 10310;

The LIKE predicate allows you to check whether a character string value meets a specified pattern. 

For example, the following query returns employees whose last names start with D.

www.it-ebooks.info





Download 10,93 Mb.

Do'stlaringiz bilan baham:
1   ...   90   91   92   93   94   95   96   97   ...   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