Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select *
- from (select <columns>,
- count() over (partition by "это поле") cnt
- from my_table)
- where cnt = 1
- select c.*,
- (select count(*) from city c1 where c1.descr = c.descr) as descr_count,
- (select count(*) from city c1 where c1.name = c.name) as name_count
- from city c
- having descr_count = 1 /* или name_count = 1 */
Add Comment
Please, Sign In to add comment