133 | | |
| 133 | select sum(prv.cnt) as Prv_Kvartal , sum(vtor.cnt1) as Vtor_Kvartal, sum(tret.cnt2) as Tret_Kvartal, sum(cetvrt.cnt3) as Cetvrt_Kvartal |
| 134 | from( |
| 135 | select count(d.delivery_id) as cnt |
| 136 | from project.delivery as d |
| 137 | where extract(year from d.date) = extract(year from now()) and extract(month from d.date) <=3 |
| 138 | --group by d.date,d.delivery_id |
| 139 | )as prv, |
| 140 | ( |
| 141 | select count(d.delivery_id) as cnt1 |
| 142 | from project.delivery as d |
| 143 | where extract(year from d.date) = extract(year from now()) and extract(month from d.date) > 3 and extract(month from d.date) <=6 |
| 144 | --group by d.date,d.client_id |
| 145 | )as vtor, |
| 146 | ( |
| 147 | select count(d.client_id) as cnt2 |
| 148 | from project.delivery as d |
| 149 | where extract(year from d.date) = extract(year from now()) and extract(month from d.date) > 6 and extract(month from d.date) <=9 |
| 150 | --group by d.date,d.client_id |
| 151 | )as tret, |
| 152 | ( |
| 153 | select count(d.client_id) as cnt3 |
| 154 | from project.delivery as d |
| 155 | where extract(year from d.date) = extract(year from now()) and extract(month from d.date) > 9 and extract(month from d.date) <=12 |
| 156 | --group by d.date,d.client_id |
| 157 | )as cetvrt |