Microsoft SQL seems to use the column names from the
first select. So that would be "a, b" in your example.

Rob

----- Original Message ----- From: <[EMAIL PROTECTED]>
To: "Sqlite-users" <sqlite-users@sqlite.org>
Sent: Saturday, March 25, 2006 3:45 PM
Subject: [sqlite] Column names in a UNION


Who can tell me what the "correct" column names should be
for a UNION.  For example:

 SELECT a, b FROM t1 UNION SELECT x, y FROM t2;

The result set of the query above has two columns.  Should
those columns be named a and b or x and y?

Does anybody know what the SQL standard says?  Do all the
other SQL database engines get it right or is there some
disagreement?

--
D. Richard Hipp   <[EMAIL PROTECTED]>

Reply via email to