[SQL] Subquery with IN or EXISTS

2001-09-27 Thread A. Mannisto
Hello, does anybody know why this: SELECT * FROM tab WHERE col1 IN (SELECT col2 FROM TAB2) equals this: SELECT * FROM tab WHERE EXISTS (SELECT col2 FROM TAB2 WHERE col1 = col2) but this: SELECT * FROM tab WHERE col1 IN (SELECT col2 FROM TAB2 WHERE col3='huu') equals _NOT_ this: SELECT * FROM t

Re: [SQL] Subquery with IN or EXISTS

2001-09-27 Thread A. Mannisto
Carl van Tast <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > Hi A., > > On 26 Sep 2001 07:24:41 -0700, [EMAIL PROTECTED] (A. Mannisto) > wrote: > > >Hello, > > > >does anybody know why this: > >SELECT * FROM tab WHERE

[SQL] Searching multiple fields from multiple tables

2001-07-23 Thread A. Mannisto
Hi, I should make search engine for psql environment. I works so that user sets search criterias (multiple words) and gets answers (like google does). Let say that I have one common key (primary) which is used as foreign key in rest of the tables. So I have many one_to_many relations. In thi