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

From: Menoud, Pascal <pmenoud_at_powersoft.com>
Date: 1996/12/07
Message-ID: <32af800c.67281385_at_psnews.powersoft.com>#1/1


rashid_at_rk.wbs.com (Rashid Karimov) wrote:

> In something like:
>select s.name || '':'' || s.level || '':'' || i.ios_hours
>from services s, ios i, prices p
>where i.done_validation_id = null
> and p.id = i.price_id
> and s.id = p.service_id
> and s.name in (
> select role
> from employee_roles
> where employee_id = :x1
> and skills_level >= s.level )
>order by i.date_due
>
> will reference to s.level in the subquery work ? In other
>words in the subquery can I use references to the aliases defined
>in the upper query ? I'd prefer to stick to some monster SQl stmt
>( tables aren't too big to really affect the speed) vs resorting
>to coding it via PL/SQL
>
>E-mail copy of an answer , if any would be greatly appreciated.
>
>Rashid.

yes.

I guess you should write "i.done_validation_id is null" instead of "= null" which is always false...

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

Original text of this message