|
Archives of the TeradataForumMessage Posted: Fri, 03 Feb 2012 @ 09:51:23 GMT
Hi, When using a UNION (I think any of the set operators - UNION, UNION ALL, MINUS etc) the SELECT statement ** must ** reference a table. I think this is just an ANSI syntax requirement (but not sure). If you don't have a table that should be used for the query then use one of the system ones, usually a view. Try any of the following: Select 'GE' as name FROM dbc.dbcinfo WHERE infokey = 'release' Union All Select 'ME' as name FROM dbc.dbcinfo WHERE infokey = 'release' Select 'GE' as name FROM dbc.databasesv WHERE databasename = user Union All Select 'ME' as name FROM dbc.databasesv WHERE databasename = user; Of the two above options the first will probably perform better and should (!?!?!?!) run on any Teradata system currently being used. Or of course create your own table with a UPI contaning one row. Cheers, Dave
| ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||