Re: Using upper-level alias in sub-query.

From: Yasuhiro Ushitaki <ushi_at_po.globe.or.jp>
Date: 1996/12/07
Message-ID: <01bbe443$d92f0620$LocalHost_at_dynabook>#1/1


Hi,

Yes, you can refer s.level in the sub-query.

But, line 5th must be

                         i.done_validation_id is null

Good luck.

-- 
Yasuhiro Ushitaki / Toyo Information Systems Co.,Ltd.

------
Rashid  Karimov <rashid_at_rk.wbs.com> wrote in article
<589qgp$mh4_at_nnrp1.farm.idt.net>...
 1> 
 2> 	In something like:
 3> select s.name || '':'' || s.level || '':'' || i.ios_hours
 4>                         from services s, ios i, prices p   where
 5>                         i.done_validation_id = null
 6>                         AND
 7>                         p.id = i.price_id
 8>                         AND
 9>                         s.id = p.service_id
10>                         AND
11>                         s.name in ( select role from employee_roles
where
12>                                             employee_id = :x1
13>                                             AND
14>                                             skills_level >= s.level )
order by i.date_due
15> 
16> 	will reference to s.level  in the subquery work ?  In other
17> words in the subquery can I use references to the aliases defined
18> in the upper query ? I'd prefer to stick to some monster SQl stmt
19> ( tables aren't too big to really affect the speed) vs resorting
20> to coding it via PL/SQL


 
Received on Sat Dec 07 1996 - 00:00:00 CET

Original text of this message