Why is there no error about "Not unique table/alias"

Viewed 20

SQL like this: (test_db has one table t, table t has one column id)

USE test_db;
SELECT * FROM t, (SELECT * FROM test_db.t) as t;

I think there will be an error here "Not unique table/alias", but it doesn't.
I guess their unique name actually is test_db.t and t(no database?)

Now, I want to expand the star to fields, just like:

SELECT test_db.t.id, ? FROM t, (SELECT * FROM test_db.t) as t;

what should I do?
Or rather, what is the unique name of the derived table?
(When I use t, It is actually both test_db.t and derived table t)

0 Answers
Related