Search Postgresql Archives

Re: Proper relational database?

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

 



On 23 April 2016 at 07:08, Manuel Gómez <targen@xxxxxxxxx> wrote:
> but its semantics can be rather wonky.  Witness:
>
> postgres=# select 1;
>  ?column?
> ----------
>         1
> (1 row)
>
> postgres=# select 1 union select 1;
>  ?column?
> ----------
>         1
> (1 row)


Exactly what you would expect. Use UNION ALL to get two rows.

> postgres=# select;
> --
> (1 row)
>
> postgres=# select union select;
> --
> (2 rows)

SELECT with no values is selecting a NULL, and two NULLs do not
equate, so you would expect two rows.

> postgres=# select 1 intersect select 1;
>  ?column?
> ----------
>         1
> (1 row)
>
> postgres=# select intersect select;
> --
> (2 rows)

See above.

Geoff


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[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