Welcome Guest, Not a member yet? Register   Sign In
Column naming in joined tables
#1

[eluser]Ingonyama[/eluser]
If I have 2 tables events and categories and they both have columns with the same names:

events table columns:
id, title, description, category_id
categories table columns:
id, title, description, order_num

SELECT * FROM events JOIN categories ON events.category_id = categories.id

Will produce:
id, title, description, category_id, id, title, description, order_num

Is it standard practice to prefix with the table name when using this kind of join so we can tell which column we are dealing with? Or is there something I'm missing here?


Messages In This Thread
Column naming in joined tables - by El Forum - 11-12-2009, 06:30 PM
Column naming in joined tables - by El Forum - 11-12-2009, 07:33 PM
Column naming in joined tables - by El Forum - 11-12-2009, 08:20 PM
Column naming in joined tables - by El Forum - 11-12-2009, 11:34 PM



Theme © iAndrew 2016 - Forum software by © MyBB