Search Postgresql Archives

Re: Query problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2007/10/12, Clemens Schwaighofer <cs@xxxxxxxxxxxxx>:
> hi,
>
> thats the first time I am a bit confused by a query not working.
>
> I have this table:
>
> gullevek=# \d test
>                                  Table "public.test"
>  Column  |       Type        |                       Modifiers
> ---------+-------------------+--------------------------------------------------------
>  test_id | integer           | not null default
> nextval('test_test_id_seq'::regclass)
>  email_a | character varying |
>  email_b | character varying |
> Indexes:
>     "test_pkey" PRIMARY KEY, btree (test_id)
>
> with this content:
>
> gullevek=# select * from test;
>  test_id |    email_a    |   email_b
> ---------+---------------+-------------
>        2 | test@xxxxxxxx | bar@xxxxxxx
>        1 | foo@xxxxxxx   |
> (2 rows)
>
> if I do this select:
>
> select * from (select test_id, email_a FROM test WHERE email_a =
> 'moo@xxxxxxx') as s, (select test_id, email_b from test where email_b =
> 'bar@xxxxxxx') as t;
>

you get 0 rows. moo@xxxxxxx isn't anywhere and bar@xxxxxxx cannot do
pair with any. else 0 * 1 = 0

Pavel

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your
       message can get through to the mailing list cleanly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux