You can also use a CASE _expression_ like this:


select ... from .. where ..
order by case when priority = 'high' then 1 when priority = 'med' then 2 when priority = 'low' then 3 end


The explicit priority table is a good idea too, and if you use it "fully", will probably make the whole app cleaner.


    Mark

-----Original Message-----
From: Greg Morphis [mailto:[EMAIL PROTECTED]
Sent: Monday, October 11, 2004 12:54 PM
To: CF-Talk
Subject: Re: grouping by...

assign another field to the importance table, maybe called priorityID
priorityID        Priority
0                   Low
1                   Normal
2                   High

Then order by priorityID desc

On Mon, 11 Oct 2004 12:30:37 -0400, Phillip Perry
<[EMAIL PROTECTED]> wrote:
> Hi,
>
> I want to arrange my data that is being displayed by the database field
> "importance". I want High to be shown first, then Normal, then Low (which
> are the 3 choices in the importance table"). How can i get Normal items to
> show up before Low items?
>
>
  _____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to