Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- country | landscape | household
- --------------------------------
- TZA | L01 | HH02
- TZA | L01 | HH03
- KEN | L02 | HH01
- RWA | L03 | HH01
- SELECT country,
- landscape,
- household,
- flag_duplicates(country, landscape) AS flag
- FROM mytable
- country | landscape | household | flag
- ---------------------------------------
- TZA | L01 | HH02 | duplicated
- TZA | L01 | HH03 | duplicated
- KEN | L02 | HH01 |
- RWA | L03 | HH01 |
- IF (country || landscape IN (SELECT country || landscape FROM mytable
- GROUP BY country || landscape)
- HAVING count(*) > 1) THEN 'duplicated'
- ELSE NULL
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement