71 | | ( |
72 | | SELECT COUNT(*) |
73 | | FROM RoomRequest |
74 | | WHERE status = 'Pending' |
75 | | ) AS br_studenti_koi_pobarale_soba_i_cekaat_odgovor, |
76 | | ( |
77 | | SELECT COUNT(*) |
78 | | FROM Room |
79 | | WHERE is_available = TRUE AND capacity > 0 |
80 | | ) AS brojka_na_slobodni_sobi_posle_prviot_den |
| 71 | b.block_id AS Block, |
| 72 | ( |
| 73 | SELECT COUNT(*) |
| 74 | FROM Room r |
| 75 | WHERE r.block_id = b.block_id |
| 76 | AND r.is_available = TRUE |
| 77 | AND r.capacity > 0 |
| 78 | ) AS brojka_na_slobodni_sobi_posle_prviot_den, |
| 79 | ( |
| 80 | SELECT COUNT(*) |
| 81 | FROM RoomRequest rr |
| 82 | WHERE rr.status = 'Pending' |
| 83 | AND rr.block_id = b.block_id |
| 84 | ) AS br_studenti_koi_pobarale_soba_i_cekaat_odgovor |
| 85 | FROM |
| 86 | Block b |
| 87 | ORDER BY |
| 88 | b.block_id |