Re: Order By - Conditional
From: Hugo Kornelis (hugo_at_pe_NO_rFact.in_SPAM_fo)
Date: 09/15/04
- Next message: squarepants4117: "Updating Table in SQL"
- Previous message: Wes: "Re: Order By - Conditional"
- In reply to: Wes: "Re: Order By - Conditional"
- Next in thread: Wes: "Re: Order By - Conditional"
- Reply: Wes: "Re: Order By - Conditional"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 15 Sep 2004 21:01:40 +0200
On Wed, 15 Sep 2004 10:14:33 -0700, Wes wrote:
>I have tried the following but with no success...
>
>ORDER BY CASE WHEN Status > 11 THEN Name END,
>CASE WHEN Status <= 11 THEN Order_ID END
>
>
>Is there any other approach I can use?
>
>Thanks in advance
Hi Wes,
Could you be more specific? What happened when you tried the code above?
Did you get an error? Unexpected results? Explosions in the server room?
I don't see anything wrong with the code snippet above. To goo further
into this, I must reproduce your situation on my system. To do that, you
should post more information. To be precise, I need:
1. Table structure, posted as DDL (CREATE TABLE statements; irrelevant
columns may be omitted but please do include all constraints);
2. Enough sample data to show what you want to achieve, posted as INSERT
statements;
3. The output you expect from the sample data you posted;
4. The complete SQL statement you are currently using plus the output you
are getting from it - if it's an error message, please copy and paste the
complete text;
5. A short and concise description of the business problem you're trying
to solve.
With that, I should be able to reproduce your problem and search for a
solution.
Best, Hugo
-- (Remove _NO_ and _SPAM_ to get my e-mail address)
- Next message: squarepants4117: "Updating Table in SQL"
- Previous message: Wes: "Re: Order By - Conditional"
- In reply to: Wes: "Re: Order By - Conditional"
- Next in thread: Wes: "Re: Order By - Conditional"
- Reply: Wes: "Re: Order By - Conditional"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|