in my table A {ID, FID, Name , Age}
in my table B{ID, Job}
When I use
SELECT ID // I want to get the ID of table B //**error**//
FROM A TA JOIN B TB
ON TA.ID = TB.FID
ORDER BY TA.Name;
Error: ambiguous column name ID
Is there anyway to do that without having to rename the column name? (The Worst scenario)
Thank you
SELECT TB.ID
FROM A TA JOIN B TB
ON TA.ID = TB.FID
ORDER BY TA.Name;
Use the full name (table name and column name seperated by a dot) to specifically select a column.
Your query doesn't fit your described table structure, I guess you swapped table A with table B.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With