How to Display Table Names in query tab??
| User, date | Message |
|---|---|
|
Written by djlerman
3 years ago Category: General 10 posts since Wed, 30 Jun 10 |
when I create and run a query (in the query tab) that selects from or joins several tables, How do I get the table name to display in the results along with the fields names? Thank you, ~Donavon |
|
Written by ansgar
3 years ago 3949 posts since Fri, 07 Apr 06 |
djlerman wrote: How do I get the table name to display in the results You mean, that HeidiSQL is displaying "Result #1", "Result #2" and so forth? That's for cases in which the table name is not determinable, as you say with joins. |
|
Written by djlerman
3 years ago 10 posts since Wed, 30 Jun 10 |
This is what I would like to do. select t1.field1, t2.field1 from table1 t1, table2 t2 CURRENT OUTPUT: field1 field1 blablabla blablabla blablabla blablabla blablabla blablabla OUTPUT IM LOOKING FOR: t1.field1 t2.field1 blablabla blablabla blablabla blablabla blablabla blablabla |
|
Written by djlerman
3 years ago 10 posts since Wed, 30 Jun 10 |
Sorry. I can't edit my posts and I wanted to add this.. In other words I have more then one table with the same field names. When I do a select in the query tab just the field names show up, so I don't know which field name is from which table. |
|
Written by ansgar
3 years ago 3949 posts since Fri, 07 Apr 06 |
Ah I see. Makes sense for joins but feels ugly when you do some simple SELECT * FROM tbl doesn't it? |
|
Written by kalvaro
3 years ago 440 posts since Thu, 29 Nov 07 |
Just assign aliases: select t1.field1 AS 't1.field1', t2.field1 AS 't2.field1' HeidiSQL displays names in the same way any other SQL tool. Anything else would be confusing IMHO. |
|
Please login to leave a reply, or register at first. |