您的位置:首页 > 数据库

从sql查询结果集中查询

2010-11-11 17:22 162 查看
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
他不作为条件,再用来查询了
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: