vadviktor
12/18/2013 - 1:58 PM

In MYSQL we want to have an independent array called 'virtual'. We want to know those rows that are not in another table's results.

In MYSQL we want to have an independent array called 'virtual'. We want to know those rows that are not in another table's results.

SELECT
  `virtual`.`psc`
FROM
  ( SELECT
      11005 AS `psc`
    UNION SELECT
      15400 AS `psc`
    UNION SELECT
      19009 AS `psc`
# ...
    UNION SELECT
      79813 AS `psc` )
    AS `virtual`
WHERE
  `virtual`.`psc` NOT IN (
    SELECT
      `ceska_posta_zip`.`psc`
    FROM
      `ceska_posta_zip`
  )