gooofy — 2012-01-21T17:31:48-05:00 — #1
When joining two tables and they each have the same column name "id", the result will include data for both "id" columns in both tables.
I would like the select statement to produce the list of columns with the table name prefixed:
report.id, report.status, status.id, status.name
r937 — 2012-01-21T17:44:11-05:00 — #2
yes, possible, but not with the dots, rather, using column alias names
SELECT customers.id <font color='"#0000FF"'>AS cust_id</font>
, orders.id <font color='"#0000FF"'>AS order_id</font>
ON orders.customer_id = customers.id
gooofy — 2012-01-21T19:52:16-05:00 — #3
What if I want this generically, meaning, I want to get all columns like that.
Can I use the wild card '*'?
r937 — 2012-01-21T21:08:14-05:00 — #4
no, that wouldn't allow you to assign aliases, you have to write them all out