SELECT COMPANY, CREDIT_LIMIT
FROM CUSTOMERS
WHERE COMPANY = 'Apelsin'
Quyidagicha '%' shablonli LIKE operatorini qo‘llaymiz:
SELECT COMPANY, CREDIT_LIMIT
FROM CUSTOMERS
WHERE COMPANY LIKE '%n'
Bu xolda LIKE '%n' operatori 'n' harfiga tugaydigan hamma yozuvlarni ko‘rsatadi, agar '%' shabloni birinchi kelsa:
SELECT COMPANY, CREDIT_LIMIT
FROM CUSTOMERS
WHERE COMPANY LIKE '%gan'
Ba’zida '%' shabloni o‘rniga '*' belgisi qo‘llanadi , masalan MS SQL uchun, c:\>dir *.exe!
Agar faqat bitta simvol ixtiyoriy bo‘lsa '_'! shabloni qo‘llanadi. Masalan:
SELECT COMPANY, CREDIT_LIMIT
FROM CUSTOMERS
WHERE COMPANY LIKE 'Ap_lsin'
Operator IS NULL
SELECT operatori uchun NULL qiymati bilan ishlash qoidalarini ko‘ramiz. Konkret misol ko‘ramiz:
Hali ofisga biriktirilmagan xizmatchini topish:
SELECT NAME FROM SALESREPS
Do'stlaringiz bilan baham: |