Uwe C. Schroeder wrote:
On Saturday 07 July 2007, Lew wrote:
So if your RDBMS sorts NULLs after all other values, then from
select start_date from show_date
order by
case when start_date > CURRENT_DATE then start_date end desc,
case when start_date <= CURRENT_DATE then start_date end asc
On Saturday 07 July 2007, Lew wrote:
> So if your RDBMS sorts NULLs after all other values, then from
>
> >> select start_date from show_date
> >> order by
> >> case when start_date > CURRENT_DATE then start_date end desc,
> >> case when start_date <= CURRENT_DATE then start_date end asc;
>
>
Perry Smith wrote:
I see. So, in effect he has:
ORDER BY NULL DESC, start_date ASC;
or
ORDER BY start_date DESC, NULL ASC;
Not exactly. He has (first sort clause) *and* (second sort clause), not "or".
Both sort clauses operate at all rows.
You are sort of correct in that for any gi
On Jul 7, 2007, at 2:15 PM, Tom Lane wrote:
Perry Smith <[EMAIL PROTECTED]> writes:
On Fri, Jul 06, 2007 at 08:02:54PM +0400, Viatcheslav Kalinin wrote:
# select start_date from show_date
# order by
# case when start_date > CURRENT_DATE then start_date end desc,
# case when start_date <= CURR
On Sat, Jul 07, 2007 at 01:49:09PM -0500, Perry Smith wrote:
> >># select start_date from show_date
> >># order by
> >># case when start_date > CURRENT_DATE then start_date end desc,
> >># case when start_date <= CURRENT_DATE then start_date end asc;
> >>
> I am very novice, but that looks odd to m
Perry Smith <[EMAIL PROTECTED]> writes:
>> On Fri, Jul 06, 2007 at 08:02:54PM +0400, Viatcheslav Kalinin wrote:
> # select start_date from show_date
> # order by
> # case when start_date > CURRENT_DATE then start_date end desc,
> # case when start_date <= CURRENT_DATE then start_date end asc;
>
>
On Fri, Jul 06, 2007 at 08:02:54PM +0400, Viatcheslav Kalinin wrote:
# select start_date from show_date
# order by
# case when start_date > CURRENT_DATE then start_date end desc,
# case when start_date <= CURRENT_DATE then start_date end asc;
I am very novice, but that looks odd to me. I would
"Louis-David Mitterrand" <[EMAIL PROTECTED]> writes:
> However if I try:
>
> select start_date from show_date order by 'start_date desc';
>
> I get a:
>
> ERROR: non-integer constant in ORDER BY
The quotes mean you are asking to sort by the string "start_date desc" which
is an error
On Fri, Jul 06, 2007 at 08:02:54PM +0400, Viatcheslav Kalinin wrote:
>
> # select start_date from show_date
> # order by
> # case when start_date > CURRENT_DATE then start_date end desc,
> # case when start_date <= CURRENT_DATE then start_date end asc;
The strange thing is when I try:
sel
On Fri, Jul 06, 2007 at 08:02:54PM +0400, Viatcheslav Kalinin wrote:
> Louis-David Mitterrand wrote:
>
> # select start_date from show_date
> # order by
> # case when start_date > CURRENT_DATE then start_date end desc,
> # case when start_date <= CURRENT_DATE then start_date end asc;
But... this w
Louis-David Mitterrand wrote:
Hi,
I am trying the following:
critik=# select start_date from show_date order by case when start_date
> CURRENT_DATE then start_date desc else start_date asc end;
ERROR: syntax error at or near "desc"
LINE 1: ...se when start_date > CURRENT_DATE
Louis-David Mitterrand wrote:
Hi,
I am trying the following:
critik=# select start_date from show_date order by case when start_date
> CURRENT_DATE then start_date desc else start_date asc end;
ERROR: syntax error at or near "desc"
LINE 1: ...se when start_date > CURRENT_DATE
12 matches
Mail list logo