[QUESTIONS] ORDER BY and nulls (fwd)

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

[QUESTIONS] ORDER BY and nulls (fwd)

От:
Bruce Momjian <maillist@candle.pha.pa.us>
Дата:
Is this fixed yet?

Forwarded message:
> I seem to recall that someone here said that because of the way comparisons
> are done, in an ORDER-BY query, the NULLs will always come up last.
> 
> It seems to have another effect, too: if I do a SELECT ... ORDER BY
> col1,col2 - and the col1 attribute has nulls, the rows with the nulls don't
> get sorted at all.
> 
> Apparently, this is because the rows which have NULL in the col1 attribute
> are not considered to have an equal value in col1, which is the requirement
> for sorting on col2 - or am I missing something here?
> 
> Herouth
> 
> 
> 
> 


-- 
Bruce Momjian
maillist@candle.pha.pa.us

Re: [HACKERS] [QUESTIONS] ORDER BY and nulls (fwd)

От:
"Vadim B. Mikheev" <vadim@sable.krasnoyarsk.su>
Дата:
Bruce Momjian wrote:
> 
> Is this fixed yet?
> 
> Forwarded message:
> > I seem to recall that someone here said that because of the way comparisons
> > are done, in an ORDER-BY query, the NULLs will always come up last.
> >
> > It seems to have another effect, too: if I do a SELECT ... ORDER BY
> > col1,col2 - and the col1 attribute has nulls, the rows with the nulls don't
> > get sorted at all.
> >
> > Apparently, this is because the rows which have NULL in the col1 attribute
> > are not considered to have an equal value in col1, which is the requirement
> > for sorting on col2 - or am I missing something here?

I hope to fix this after Feb 1 (seems easy to do).

Vadim
FAQ