I don’t understand how to fix this. PhpMyAdmin cannot find columns. I even gave each query a name but it doesn’t work.
SELECT ename,
deptno FROM ( SELECT sal
FROM emp T
) as E
WHERE deptno = 10;
I don’t understand how to fix this. PhpMyAdmin cannot find columns. I even gave each query a name but it doesn’t work.
SELECT ename,
deptno FROM ( SELECT sal
FROM emp T
) as E
WHERE deptno = 10;
3
Answers
you have not a column named ename in the subquery that you are use as table
could be you don’t need the subquery
or if you really need the subquery then this must contain the column you are looking for
Your sql is wrong, you are trying to select
ename
anddeptno
columns from tableE
.E
alias from(SELECT sal FROM emp T)
, so it has the only one field named sal.SELECT sal FROM emp T
, return a table with only "sal" column. You select column ename and deptno from a table have only sal column is impossible.