I have an sql which select value from a table calculated by another sql:
select t.netlist_id from
(select c from cl2 where pid = 1 order by id limit 1) as t
and I get error message below:
#1054 Unknown column "t.netlist_id" in "field list"
if I change the original sql like this:
select t.* from
(select c from cl2 where pid = 1 order by id limit 1) as t
I get the result of select c from cl2 where pid = 1 order by id limit 1
Why would this happen and how can I correct my sql?
content of table cl2
|pic|c |
------------
|1 |dcdc |
content of table dcdc
|netlist_id|
------------
|1 |