Answer the question
In order to leave comments, you need to log in
How to fix field name conflict in INNER JOIN (T-SQL)?
Hello!
Let's say there are several tables that need to be linked. Some of us have "title" fields. So, because of this coincidence, an error comes out, and specifically, in a new table (after all, the function returns a table value) there cannot be two columns with the same names. Everything is logical.
The question is how to fix it? For example, in SELECT prescribes all these fields "title", and below we rename them. How to implement it?
Answer the question
In order to leave comments, you need to log in
Elementary.
SELECT t.title as t1Title, t2.title as t2Title FROM table1 as t
INNER JOIN table2 as t2 ON t2.id = t.id
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question