clear markdown compare help best fiddles feedback dbanow.uk a leap of faith?
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 1130741 fiddles created (16587 in the last week).

CREATE TABLE table_name ( City, Value ) AS SELECT 'Helsinki', 1 FROM DUAL UNION ALL SELECT 'Helsinki', 2 FROM DUAL UNION ALL SELECT 'Helsinki', 5 FROM DUAL UNION ALL SELECT 'Kuopio', 4 FROM DUAL UNION ALL SELECT 'Kuopio', 5 FROM DUAL UNION ALL SELECT 'Joensuu', 1 FROM DUAL UNION ALL SELECT 'Joensuu', 2 FROM DUAL UNION ALL SELECT 'Joensuu', 3 FROM DUAL
8 rows affected
 hidden batch(es)


SELECT city, v.value FROM ( SELECT LEVEL AS value FROM DUAL CONNECT BY LEVEL <= ( SELECT MAX( value ) FROM table_name ) ) v LEFT OUTER JOIN table_name t PARTITION BY ( t.City ) ON ( v.value = t.value ) WHERE t.value IS NULL
CITY VALUE
Helsinki 3
Helsinki 4
Joensuu 4
Joensuu 5
Kuopio 1
Kuopio 2
Kuopio 3
 hidden batch(es)