Skip site navigation (1) Skip section navigation (2)

Re: A strange problem

From: Douglas McNaught <doug(at)mcnaught(dot)org>
To: Tang Tim Hei <timheit(at)netvigator(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: A strange problem
Date: 2005-08-27 15:24:34
Message-ID: m24q9bo11p.fsf@Douglas-McNaughts-Powerbook.local (view raw or flat)
Thread:
Lists: pgsql-general
Tang Tim Hei <timheit(at)netvigator(dot)com> writes:

> Hi,
>   I'm new to postgresql. Anytime I type the following command to the database to run, it give me no result record if table 'country' is empty but can get result if 'country' is not empty. Is this so strange?
>
>   select A.* from test.currency A, test.country B where A.curr_cd='USD'

You're doing an unconstrained join on "currency" and "country", and if
one of those two tables is empty the result will be empty.

-Doug

In response to

pgsql-general by date

Next:From: Stephan SzaboDate: 2005-08-27 15:25:49
Subject: Re: A strange problem
Previous:From: Tang Tim HeiDate: 2005-08-27 15:00:07
Subject: A strange problem

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group