Sql server® 2012 t-sql fundamentals



Download 10,93 Mb.
Pdf ko'rish
bet116/443
Sana26.01.2022
Hajmi10,93 Mb.
#411755
1   ...   112   113   114   115   116   117   118   119   ...   443
Bog'liq
BookSQL

The 

LIKE

 predicate

T-SQL provides a predicate called LIKE that allows you to check whether a character string matches a 

specified pattern. Similar patterns are used by the PATINDEX function described earlier. The following 

section describes the wildcards supported in the patterns and demonstrates their use.



The 

%

 (percent) Wildcard

The percent sign represents a string of any size, including an empty string. For example, the following 

query returns employees where the last name starts with D.

SELECT empid, lastname 

FROM HR.Employees 

WHERE lastname LIKE N'D%';

This query returns the following output.

empid       lastname 

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

1           Davis 

9           Dolgopyatova

Note that often you can use functions such as SUBSTRING and LEFT instead of the LIKE predicate 

to represent the same meaning. But the LIKE predicate tends to get optimized better—especially 

when the pattern starts with a known prefix.

www.it-ebooks.info



72  

Microsoft SQL Server 2012 T-SQL Fundamentals




Download 10,93 Mb.

Do'stlaringiz bilan baham:
1   ...   112   113   114   115   116   117   118   119   ...   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