MySQL Forums
Forum List  »  Newbie

Using tables alias and table name
Posted by: Peter Poulsen
Date: August 18, 2005 12:40AM

I had this little conversation with the test DB of my MySQL 4.1.12a-nt.

[sample]
mysql> create table foo (a int, b real);
Query OK, 0 rows affected (0.05 sec)

mysql> insert into foo values(10, 14.5);
Query OK, 1 row affected (0.00 sec)

mysql> select a, alt.b from foo alt;
+------+------+
| a | b |
+------+------+
| 10 | 14.5 |
+------+------+
1 row in set (0.00 sec)

mysql> select foo.a, alt.b from foo alt;
ERROR 1109: Unknown table 'foo' in field list
[/sample]

As you can see I cannot use both alias and table name in the same query. As I have a bunch of old queries that does that, I would like if it is possible to make MySQL accept that. I there some option I can set that makes that happen?

Yours
Peter

Options: ReplyQuote


Subject
Written By
Posted
Using tables alias and table name
August 18, 2005 12:40AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.