- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
select
row_number() over (order by count(*) desc) r,
case when t719.f7171 is null and t719.f7201 is null then 'За поданням
голови ОВК, капітана судна, керівн. полярної станції України'
when t719.f7171 is not null then t717.name1
when t719.f7201 is not null then t720.f7202||'
'||t720.f7203||' '||t720.f7204
end t021f02,
count(*) count1
from t719,
t066,
t714,
v1_t717 t717,
t720
where t719.t001f01=PT001F01 and
t719.t001f01=t066.t001f01 and
t719.f7331=t066.f7331 and
t719.f7141=t066.f7141 and
t719.f7191=t066.f7191 and
t066.T066F02 is not null and
t066.T066F03 is null and
t719.t001f01=t714.t001f01 and
t719.f7331=t714.f7331 and
t719.f7141=t714.f7141 and
t714.f71480 is null and
t719.f7171=t717.f7171(+) and
t719.t001f01=t717.t001f01(+) and
t719.f7201=t720.f7201(+) and
t719.t001f01=t720.t001f01(+)
group by case when t719.f7171 is null and t719.f7201 is null then 'За
поданням голови ОВК, капітана судна, керівн. полярної станції України'
when t719.f7171 is not null then t717.name1
when t719.f7201 is not null then t720.f7202||'
'||t720.f7203||' '||t720.f7204
end
order by count(*) desc, 1;
Оттуда же.
Ну и как такое можно сапортить?