[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgresql-general
Subject:    Re: [GENERAL] Quetions on Joins
From:       Ron Johnson <ron.l.johnson () cox ! net>
Date:       2003-08-31 19:29:17
[Download RAW message or body]

On Sun, 2003-08-31 at 11:56, Alex wrote:
> Hi,
> 
> I have a query where I want to filter out records from table_a if a 
> field in table_a matches in table table_b. Basically table_b defines the 
> filter.
> 
> If table_b however is empty i dont get any results
> 
> SELECT A.value_one FROM table_a AS A, table_b AS B WHERE  A.value_two <> 
> B.value_two;
> or
> SELECT A.value_one FROM table_a AS A, table_b AS B WHERE  A.value_two <> 
> B.value_two AND B.value_two NOTNULL;
> 
> Only work if the there is a value in table_b.
> Could anyone tell me if there is a way to do that ?

If the filter is empty, how can you filter anything?

> PS: I'd like to thank here persons who reply rather than sending the 
> message per mail.

What does that mean?

-- 
-----------------------------------------------------------------
Ron Johnson, Jr. ron.l.johnson@cox.net
Jefferson, LA USA

"they love our milk and honey, but preach about another way of living"
Merle Haggard, "The Fighting Side Of Me"


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faqs/FAQ.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic