question abut "order by" null fields - Mailing list pgsql-general

From Alessandro Vincelli
Subject question abut "order by" null fields
Date
Msg-id 42C50B02.5030404@alessandro.vincelli.name
Whole thread Raw
Responses Re: question abut "order by" null fields
List pgsql-general
Hi

I have 2 table

table1:
    id
    column1


table2:
    id
    column2


I perform this query


SELECT column1, column2 FROM table1 LEFT JOIN table2 USING (id)
ORDER BY column1, column2

In the rows where column1 is not null postgres perform ORDER BY column1,
column2

Problem:
In the rows where Column1 is null, postgres don't perform  ORDER BY  on
the column2

Why?

Same behavior when:

SELECT column1, column2 FROM table1 LEFT JOIN table2 USING (id)
ORDER BY coalesce(column1,''), column2


Thanks in advance

--
-------------------------------
Alessandro Vincelli




pgsql-general by date:

Previous
From: Ajay Dalvi
Date:
Subject: How to uninstall PostGreSql from linux
Next
From: Tom Lane
Date:
Subject: Re: PostgreSQL sequence within function