Subject | Re: [firebird-support] using clause |
---|---|
Author | Helen Borrie |
Post date | 2011-09-24T19:20:23Z |
At 05:57 AM 25/09/2011, you wrote:
For an output set from a join you don't need manufacture matching column names - you're just matching data.
SELECT
u.username,
u.whateverelse
from users u join test t
ON t.poster_username = u.username
./hb
>How can I use the using clause on a join between two tables that have diff column names? Do I have to use a derived table to rename the columns first?USING is a part of the MERGE statement syntax, not apparently what you are after here (assumes I understand what you want to achieve, of course!)
>
>EX:
>SELECT username FROM users INNER JOIN
>(SELECT poster_username AS username FROM test) USING(username);
For an output set from a join you don't need manufacture matching column names - you're just matching data.
SELECT
u.username,
u.whateverelse
from users u join test t
ON t.poster_username = u.username
./hb