10.5. UNION、CASE 等相關結構
SELECT text 'a' AS "text" UNION SELECT 'b';
text
------
a
b
(2 rows)Last updated
Was this helpful?
Was this helpful?
SELECT 1.2 AS "numeric" UNION SELECT 1;
numeric
---------
1
1.2
(2 rows)SELECT 1 AS "real" UNION SELECT CAST('2.2' AS REAL);
real
------
1
2.2
(2 rows)SELECT NULL UNION SELECT NULL UNION SELECT 1;
ERROR: UNION types text and integer cannot be matched(SELECT NULL UNION SELECT NULL) UNION SELECT 1;