List:General Discussion« Previous MessageNext Message »
From:David T. Ashley Date:August 5 2006 11:57pm
Subject:SELECT with Result Ordered by Minimum of Fields
View as plain text  
Hi,

I have a table and I'd like to do a SELECT query with the result ordered by
the minimum of two fields.  I might also like to query by the minimum (but
that is an easier problem, as I can just rephrase it as an OR).

Can I just write something like:

SELECT * FROM mytable WHERE fieldofinterest<value ORDER BY MIN(field1,
field2) ASC;

or is it more complicated or impossible?

Thanks, Dave.

Thread
SELECT with Result Ordered by Minimum of FieldsDavid T. Ashley6 Aug
  • Re: SELECT with Result Ordered by Minimum of FieldsChris W6 Aug
    • Re: SELECT with Result Ordered by Minimum of FieldsDavid T. Ashley6 Aug
      • Re: SELECT with Result Ordered by Minimum of FieldsChris W6 Aug