[SQL] subselect return in where clause

2003-01-28 Thread Michael Hostbaek
Group, Is it possible to use a subselect result in a where statement ? If so, how ? Fx. select some_stuff, more_stuff, (select other_stuff from other_table where other_table.stuff ilike stuff.match) as other_stuff from stuff where other_stuff = 'hello' thanks. -- Best Regards, Michael

Re: [SQL] optimal sql

2003-01-22 Thread Michael Hostbaek
Tomasz Myrta (jasiek) writes: > > 3. Explain analyze would be helpful like in most performance cases... > The same with SQL query instead of Perl script. Explain analyze: NOTICE: QUERY PLAN: Limit (cost=27.55..27.55 rows=1 width=183) (actual time=35364.89..35365.04 rows=10 loops=1) -> Sor

[SQL] optimal sql

2003-01-22 Thread Michael Hostbaek
Hi, I am running postgresql 7.2.3 on a test server (with potential of becoming my production server). On the server I have a perl script, that is grabbing some data from a inventory database (local) - with some subselects. The query is like this: my $sth = $ppdb->prepare(" select partno, cr