Skip to content

Instantly share code, notes, and snippets.

@phantom42
Created February 19, 2014 14:34
Show Gist options
  • Save phantom42/9093295 to your computer and use it in GitHub Desktop.
Save phantom42/9093295 to your computer and use it in GitHub Desktop.
oracle "with as" subquery
WITH typelist AS
(SELECT 0 AS n
FROM DUAL
WHERE 1 = 0
UNION
SELECT 1 AS n
FROM DUAL
UNION
SELECT 2 AS n
FROM DUAL)
SELECT *
FROM personnel_type t
WHERE t.personnel_type_id NOT IN (SELECT n
FROM typelist);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment