I have two different table. One table has 70 Columes, the other has 80. I want to display all the Columes of the two tables. But there are some Columes with the same Columes-name.
EX:
SELECT *
FROM TABLE1 A INNER JOIN
TABLE2 B ON A.ID = B.ID
I want to distinguish which table does the Columes comes from.
I know have to list your column list explicitly and provide aliases to them in the SELECT list.
How can I modify my program?
Is there any other easier way.
Because there are too many field names
You'll have to list your column list explicitly and provide aliases to them in the SELECT list.
As a best practice
SELECT *in production queries, always list the required columns explicitly. Why is SELECT * considered harmful?