Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ak_code bnum craft_type
- AA RA-85205 T154
- AA RA-85162 T154
- AA RA-26305 AN26
- BB RA-85343 T154
- CC RA-96002 IL96
- CC RA-96012 IL96
- CC RA-96016 IL96
- select ak_code,craft_type from crafts
- where ak_code in(
- select ak_code from crafts
- group by ak_code
- having count(bnum)>1
- )
- group by ak_code,craft_type
- ak_code craft_type
- AA AN26
- AA T154
- CC IL96
- ak_code craft_type
- CC IL96
- select ak_code,craft_type from crafts
- where ak_code in(
- select ak_code from crafts
- group by ak_code
- having count(bnum)>1 -- Количество бортов более 1 (аналогично count(1))
- and count(distinct craft_type)=1 -- Только один уникальный тип ВС
- )
- group by ak_code,craft_type
- select ak_code,max(craft_type) from crafts
- group by ak_code
- having count(bnum)>1
- and max(craft_type)=min(craft_type)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement