Misol: Familiyalari A xarfi bilan boshlanuvchi talabalar ro‘yxatini
tanlab olish.
Bunday xolatda
LIKE operatoridan foydalanish qulay hisoblanadi.
LIKE operatori faqat simvolli maydonlar uchun qo‘llaniladi
va maydon
qiymati operatorda ko‘rsatilgan namunaga mosligini
tekshirish imkonini
yaratadi. Namuna quyidagi maxsus simvollardan tashkil topadi:
_ (tagiga chizish belgisi) – bitta ixtiyoriy simvolni bildiradi;
% (foiz belgisi) – ixtiyoriy miqdordagi simvollar ketma – ketligini
bildiradi.
SELECT id_st, surname
FROM student
WHERE surname
LIKE 'A%'
So’rovi :
insert into student (first_name,last_name,age ,gruppa_id)
values('Suxrob', 'Vahobov',19,1);
insert into student (first_name,last_name,age ,gruppa_id)
values('Suxrob', 'Vahobov',19,1);
insert into student (first_name,last_name,age ,gruppa_id)
values('Islom', 'bahromov',19,3);
insert into student (first_name,last_name,age ,gruppa_id)
values('Xushnud', 'Xomidov',19,3);
insert into student (first_name,last_name,age ,gruppa_id)
values('Davron', 'Aliyev',19,2);
insert into student (first_name,last_name,age ,gruppa_id)
Do'stlaringiz bilan baham: