I have a lot of tables that use id
as the primary key. When I join several tables together and select *
, only one of the id columns is displayed. When using MySql, the only way I could get around this was to use SELECT AS
, for example SELECT id AS groupId
.
Is this still the case with MariaDB? My duplicate column names are not limited to just the id field, so I end up with really verbose select statements.
I was hoping that MariaDB might introduce a query feature that allowed the column names to be prefaced with their table names. For example, a query might bring back columns names group.id
and person.id
.
EDIT: Per the comments from Shadow, the problem is not with MariaDB (or MySql for that matter). The result set does indeed include multiple 'id' fields. The problem is with the client library, in my case PDO.