请教各位大虾,ID NAME AGE MANAGER
101 A 21 103
102 B 30 101
103 C 24 NULL列出年龄比下属小的主管ID,NAME,以“编号”“姓名”来命名。如何查询,谢谢!
101 A 21 103
102 B 30 101
103 C 24 NULL列出年龄比下属小的主管ID,NAME,以“编号”“姓名”来命名。如何查询,谢谢!
调试欢乐多
from yourTable a,yourTable b
where a.ID=b.MANAGER
and a.AGE<b.AGE当您的问题得到解答后请及时结贴.
http://topic.csdn.net/u/20090501/15/7548d251-aec2-4975-a9bf-ca09a5551ba5.html
select a.id id , a.name ,a.age age1, b.age age2 from yourtable a ,your table b where
a.manager = b.id(+)
) where age2 < age1