SELECT COMPANY, CREDIT_LIMIT
FROM CUSTOMERS
WHERE COMPANY = 'Apelьsin'
Quyidagicha '%' shablonli LIKE operatorini qo‘llaymiz:
SELECT COMPANY, CREDIT_LIMIT
FROM CUSTOMERS
WHERE COMPANY LIKE '%n'
Bu xolda LIKE '%n' operatori 'n' xarfiga tugaydigan xamma 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 znak, masalan v 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_lьsin'
Operator IS NULL
SELECT operatori uchun NULL qiymati bilan ishlash qoidalarini ko‘ramiz. Konkret misol ko‘ramiz:
Xali ofisga biriktirilmagan xizmatchini topish:
SELECT NAME FROM SALESREPS
Do'stlaringiz bilan baham: |