Laurent ROCHE wrote:
So I wrote:
SELECT 'TRUNCATE TABLE '
UNION
...
ORDER BY relname
And this fails with the following message:
ERROR: column "relname" does not exist
But I don't understand why this does not work: the 2 SELECTs produce a single char column so from what I understand that should work ! ? !
If some body can explain I will be grateful.
The "ORDER BY" is attached to the "UNION" not the second subquery.
Catches everyone out from time to time.
--
Richard Huxton
Archonet Ltd
---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faq