Version 1 (modified by 2 years ago) ( diff ) | ,
---|
Напредни извештаи од базата
- za odreden student kolku pati ima sedeno vo sekoj od stanovite kade ima sedeno i kolku vkupno ima plateno vo tekot na site dogovori
select stud.studentid, appus.ime, appus.prezime, b.cityname, b.building_adress, apt.apartment_adress, aa.date_signed,apt.apartmentid,aa.date_signed,aa.date_expires, count(apt.apartmentid) as kolku_pati, extract(month from age(aa.date_expires,aa.date_signed)) * sum(aa.apartment_rent) as vkupno_plateno from apartment_agreement as aa join apartment apt on apt.apartmentid = aa.apartmentid join student_signs ss on ss.agreementid = aa.apartment_agreementid join student stud on stud.studentid = ss.studentid join appuser appus on appus.userid = stud.studentid join building b on apt.buildingid = b.buildingid group by 1,2,3,4,5,6,7,8,9,10 order by stud.studentid
Note:
See TracWiki
for help on using the wiki.