Two tables. Some overlapping fieldnames. Join query. Same column name comes up twice. I would like to add the table name as a prefix to the column name just to make it easier to read. I am using the wild card * and I would like to continue to use the wildcard in the solution.
The query could be something like this:
SELECT *
FROM Loan l JOIN
LoanInstallment li
ON l.LoanId = li.LoanId
And the filed names of the result could be something like this:
LoanID | Amount | Date | LoanID | Amount | Date |
… records
Where I would like it to be
l.LoanID | l.Amount | l.Date | li.LoanID | li.Amount | li.Date |
… records
This should be very easy to do because it is obvious that SQL has no problem with having field names the same, so there is an invisible table name along with every column.
How do I display the table name, as a prefix, to the column name?
Happy Solstice