从sql查询结果集中查询


select * from 
(
        
select stu.*, ter.name
        
from student as stu, ter as term
        
where stu.t_id = ter.id  
as t 
where t.id > 10


错误:


select * from 
(
        
select stu.*, ter.*
        
from student as stu, ter as term
        
where stu.t_id = ter.id  
as t 
where t.id > 10

因为student和term表中都存在id 合的表要用来查询,不充许有重复列

下面是可以的:
 
select stu.*, ter.*
 
from student as stu, ter as term
 
where stu.t_id = ter.id 
他不作为条件,再用来查询了
原文地址:https://www.cnblogs.com/barrysgy/p/1875064.html