6 | | 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 |
| 6 | select stud.studentid, appus.ime, appus.prezime, b.cityname, b.building_adress, |
| 7 | apt.apartment_adress, aa.date_signed,apt.apartmentid,aa.date_signed,aa.date_expires, |
| 8 | count(apt.apartmentid) as kolku_pati, |
| 9 | extract(month from age(aa.date_expires,aa.date_signed)) * sum(aa.apartment_rent) as vkupno_plateno from apartment_agreement as aa |