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 
他不作为条件,再用来查询了

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-25
  • 2021-08-28
  • 2022-12-23
  • 2021-08-28
猜你喜欢
  • 2021-06-26
  • 2022-12-23
  • 2021-06-08
  • 2022-12-23
  • 2022-12-23
  • 2021-08-07
  • 2022-12-23
相关资源
相似解决方案