[HACKERS] Clarification of NULL values

Поиск
Список
Период
Сортировка
Искать

[HACKERS] Clarification of NULL values

От:
adrian@hottub.org
Дата:
from X3H2-97-030 (I think)


            c) Let P be any row of TS and let Q be any other row of TS,
              and let PVi and QVi be the values of Ki in these rows,
              respectively. The relative position of rows P and Q in the
              result is determined by comparing PVi and QVi according to
              the rules of Subclause 8.2, "", where
              the  is the applicable  for Ki, with the
              following special treatment of null values. Whether a sort
              key value that is null is considered greater or less than
              a non-null value is implementation-defined, but all sort
              key values that are null shall either be considered greater
              than all non-null values or be considered less than all non-
              null values. PVi is said to precede QVi if the value of the
               "PVi  QVi" is true for the
              applicable .


And if anyone can follow that.......

Adrian

------------------------------

Re: [HACKERS] Clarification of NULL values

От:
"Thomas G. Lockhart" <Thomas.Lockhart@jpl.nasa.gov>
Дата:
adrian@hottub.org wrote:
> >From X3H2-97-030 (I think)
> ... with the
> following special treatment of null values. Whether a sort
> key value that is null is considered greater or less than
> a non-null value is implementation-defined, but all sort
> key values that are null shall either be considered greater
> than all non-null values or be considered less than all non-
> null values. PVi is said to precede QVi if the value of the
>  "PVi  QVi" is true for the
> applicable .

Well, it means that as long as the nulls aren't scattered in the middle
of the returned ordered values you can do anything you want :)

Postgres does it correctly according to this standard...

			- Tom

------------------------------
FAQ