I am using the following query to select wait times from the table wait_times where the user id is 1 and then select the venue’s information that has the id of the wait time’s venue id.
SELECT w . * , v . *
FROM `wait_times` AS `w`
INNER JOIN `venues` AS `v` ON `v`.id = `w`.venue_id
WHERE w.user_id =1
LIMIT 0 , 30
However, when I perform this query, as I have columns named user_id and id in both tables, I received two lots of values for each column name. Please can you tell me how I make these values distinguishable, and rename them to ‘table_name.columnname’ respectively so that they can be easily recognised?
One solution would be:
Just allocate the colums which have the same name a (temporary) different name.