pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
select ... from (select .. from where.. ) where ... ?
2+ messages / 2 participants
[nested] [flat]

* select ... from (select .. from where.. ) where ... ?
@ 1999-03-31 19:35 MESZAROS Attila <tilla@chiara.csoma.elte.hu>
  1999-03-31 20:00 ` Re: [SQL] select ... from (select .. from where.. ) where ... ? Clark Evans <clark.evans@manhattanproject.com>
  0 siblings, 1 reply; 2+ messages in thread

From: MESZAROS Attila @ 1999-03-31 19:35 UTC (permalink / raw)
  To: pgsql-sql@hub.org

Hi,

I'am faced with a huge system using the above kind of queries.
It was originally written and tested with adabas.

Unfortunatelly 6.4 does support subqueries only in the 'where' expression,
as far as I undersood...

My questions are:
	How can I port this program with the least effort?
	Shall I create views corresponding to the subqueries,
	and doing the outer select on a view?

	Is is planned to implement this feature in the near future?

Thanx
Attila




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: [SQL] select ... from (select .. from where.. ) where ... ?
  1999-03-31 19:35 select ... from (select .. from where.. ) where ... ? MESZAROS Attila <tilla@chiara.csoma.elte.hu>
@ 1999-03-31 20:00 ` Clark Evans <clark.evans@manhattanproject.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Clark Evans @ 1999-03-31 20:00 UTC (permalink / raw)
  To: MESZAROS Attila <tilla@chiara.csoma.elte.hu>; +Cc: pgsql-sql@hub.org

MESZAROS Attila wrote:
> I'am faced with a huge system using the above kind of queries.
> It was originally written and tested with adabas.

I wrote a hudge system using those kind of queries.  Very
useful buggers, really helps you manage complexity.  I bet
it plays hudge games with the optimizer though...
 
> Unfortunatelly 6.4 does support subqueries only in the 'where' expression,
> as far as I undersood...

That's my understanding.  6.5 will not support it either.

> My questions are:
>         How can I port this program with the least effort?
>         Shall I create views corresponding to the subqueries,
>         and doing the outer select on a view?

You can do this, as long as the inner select does not
have an aggregate.  If it has an aggregate _or_ uses an
outer join then you need to code up functions that
do the outer-join.

>         Is is planned to implement this feature in the near future?

I hope so.  Actually, I think this is a generalization of the HAVING 
clause.  About 2 years ago (using Oracle) I dropped using the HAVING
clause due to this form... so, there is another possibility,
see if you can re-write these queries to use HAVING.

Let me know if I can help more.

Clark



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~1999-03-31 20:00 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-03-31 19:35 select ... from (select .. from where.. ) where ... ? MESZAROS Attila <tilla@chiara.csoma.elte.hu>
1999-03-31 20:00 ` Clark Evans <clark.evans@manhattanproject.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox