HAVING=WHERE, faqat HAVING guruxlar ichiga tegishli
Select Subj_name, max (hour)
From SUBJECT;
Group by Subj_name
Having max (Hour)>= 34;
Ishni bajarish tartibi 1. Zavoddan bir kunlik olinadigan maxsulotlarning 5000 kgdan kam
ishlab chiqarilganlari haqida ma`lumot berilsin:
So‟rov: Select *from maxsulot having ogirligi_kg<5000;
47
Natija:
8.1 – rasm. Having kalit so‘zining qo‘llanilishi.
2.Ikki va undan maxsulot ishlaydigan qurilmalar chiqarilsin;
So‟rov: select korpus_id as „2 tadan kop maxsulot ishlab chiqaradigan korpuslar id lari‟ , count(maxsulot_nomi) as „maxsulotlar soni‟ from maxsulot group by korpus_id having count(maxsulot_nomi)>=2; Natija: 8.2. – rasm. Group by va Having kalit so‘zlarining qo‘llanilishi.
48
Vazifalar 1. Yuqorida ko`rsatilganlardan foydalanib tanlangan variyantga
muvofiq mavzu uchun MySQL da Having buyrug`i bilan ishlang.
2. Bajarilgan ishlar haqida hisobot tayyorlang (1-2-ilovalarga qarang).