Bug #89333 in Unknown column
Submitted: 20 Jan 2018 9:25 Modified: 20 Jan 2018 23:24
Reporter: Myplus Jack Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: DML Severity:S3 (Non-critical)
Version:5.6.38,5.7.21 OS:Any
Assigned to: CPU Architecture:Any

[20 Jan 2018 9:25] Myplus Jack
Description:
mysql> CREATE TABLE t1(id INT);
Query OK, 0 rows affected (0.03 sec)

mysql> CREATE TABLE t2(ids INT);
Query OK, 0 rows affected (0.03 sec)

mysql> INSERT INTO t1 VALUES(1);
Query OK, 1 row affected (0.00 sec)

mysql> INSERT INTO t2 VALUES(1);
Query OK, 1 row affected (0.00 sec)

mysql> SELECT * FROM t1 WHERE id IN(SELECT id FROM t2);
+------+
| id   |
+------+
|    1 |
+------+
1 row in set (0.00 sec)

mysql> SELECT * FROM t1 WHERE id IN(SELECT t.id FROM t2 t);
ERROR 1054 (42S22): Unknown column 't.id' in 'field list'
mysql> 

How to repeat:
i test this in 5.6.38 and 5.7.21,but the result doesn't change.
[20 Jan 2018 9:27] Myplus Jack
add version
[20 Jan 2018 9:41] Myplus Jack
test exists:

mysql> SELECT * FROM t1 WHERE EXISTS(SELECT id FROM t2);
+------+
| id   |
+------+
|    1 |
+------+
1 row in set (0.00 sec)

mysql> SELECT * FROM t1 WHERE EXISTS (SELECT t.id FROM t2 t);
ERROR 1054 (42S22): Unknown column 't.id' in 'field list'
mysql>
[20 Jan 2018 23:24] MySQL Verification Team
We're sorry, but the bug system is not the appropriate forum for asking help on using MySQL products. Your problem is not the result of a bug.

Support on using our products is available both free in our forums at http://forums.mysql.com/ and for a reasonable fee direct from our skilled support engineers at http://www.mysql.com/support/

Thank you for your interest in MySQL.