為什麼第二個語法沒寫from emp反而沒有Error
mysql> select ename, sal ,deptno
-> from emp
-> where deptno=(select deptno
-> from emp
-> where ename like '%t%');
ERROR 1242 (21000): Subquery returns more than 1 row
mysql> select ename, sal ,deptno
-> from emp
-> where deptno=(select deptno
-> where ename like '%t%');
+--------+---------+--------+
| ename | sal | deptno |
+--------+---------+--------+
| SMITH | 800.00 | 20 |
| MARTIN | 1250.00 | 30 |
| SCOTT | 3000.00 | 20 |
| TURNER | 1500.00 | 30 |
+--------+---------+--------+
4 rows in set (0.00 sec)