Ho threre. When I run a simple select on some tables like:
SELECT
ValidoDa,
Tab_Ticket_Default,
*
FROM
Dipendente_Stor
WHERE
CodiceAbi = '08753' and
Matricola = 98
order by
ValidoDa
I can get the error “Ambiguous column name ‘ValidoDa'”
What is the reason? There is only one filed called ValidoDa!
can you explain this behaviour?
ORDER BY will first attempt to resolves SELECT column list.
In this case, you have
ValidoDatwice therefore it is ambiguousYou can fix it like this with an alias, but
SELECT *is bad practice anyway