Sorting empty rows at the bottom of a recordset

From: "Matt Arnilo S(dot) Baluyos (Mailing Lists)" <matt(dot)baluyos(dot)lists(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Sorting empty rows at the bottom of a recordset
Date: 2005-12-10 02:10:27
Message-ID: d1a6d7930512091810p457ebb80q6416f99e68fbf1d0@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hello everyone,

I have a PHP application that gets its database from PostgreSQL. I'm
trying to figure out a way to get around an ORDER BY problem.

I have a recordset that returns rows based on a column (ORDER BY
writer_lname, i.e. writer's last names). There are however rows which
have empty values and these get sorted at the top of the recordset.
What the boss would want to see is these rows to be sorted at the
bottom of the recordset.

Is there any way around this at the PostgreSQL level? I can definitely
put some code in the PHP (application) level but that would be too
inefficient I think.

Any pointers would be greatly appreciated.

Best regards,
Matt

--
Stand before it and there is no beginning.
Follow it and there is no end.
Stay with the ancient Tao,
Move with the present.

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Michael Fuhr 2005-12-10 03:12:24 Re: Sorting empty rows at the bottom of a recordset
Previous Message Michael Fuhr 2005-12-10 01:58:27 Re: Bind Variables and Quoting / Dequoting Input