Re: Question on a select - Mailing list pgsql-general

From Madison Kelly
Subject Re: Question on a select
Date
Msg-id 41D79B8C.5090909@alteeve.com
Whole thread Raw
In response to Re: Question on a select  (Bruno Wolff III <bruno@wolff.to>)
Responses Re: Question on a select  (Bruno Wolff III <bruno@wolff.to>)
List pgsql-general
Bruno Wolff III wrote:
> SELECT a_name, a_type, a_dir, a_<others> FROM table_a
>   WHERE a_name, a_type, a_dir NOT IN (
>     SELECT b_name, b_type, b_dir FROM table_b)
> ;
>
> In pre 7.4 versions or if there are NULLs in the key columns for table_b
> then you probably want to use NOT EXISTS (with a moodified WHERE clause)
> instead on NOT IN.

Hi Bruno,

   Thank you for replying! I tried your example but I am getting a
syntax error:

tle-bu=> SELECT file_name, file_parent_dir, file_type FROM file_info_1
WHERE file_name, file_parent_dir, file_type NOT IN (SELECT fs_name,
fs_parent_dir, fs_type FROM file_set_1);
ERROR:  syntax error at or near "," at character 78

   I just replied to Vincent's post with a lot of detail on what I am
trying to do and how my DB is constructed. His second example worked but
I also had a syntax error on his first example. This program will be
working with very large data sets so I would love to get your method
working so that I could try benchmarking them to see which, in my
application, would be most effective.

   Thank you very kindly for helping!

Madison

pgsql-general by date:

Previous
From: Madison Kelly
Date:
Subject: Re: Question on a select
Next
From: Bruno Wolff III
Date:
Subject: Re: Question on a select