Re: SELECT with Result Ordered by Minimum of Fields

2006-08-06 Thread Chris W
David T. Ashley wrote: On 8/6/06, Chris W <[EMAIL PROTECTED]> wrote: David T. Ashley wrote: > Can I just write something like: > > SELECT * FROM mytable WHERE fieldofinterest field2) ASC; I think this will work.. SELECT *, IF(a-b < 0,a, b) as SortField FROM table WHERE whatever ORDER BY S

Re: SELECT with Result Ordered by Minimum of Fields

2006-08-06 Thread David T. Ashley
On 8/6/06, Chris W <[EMAIL PROTECTED]> wrote: David T. Ashley wrote: > Can I just write something like: > > SELECT * FROM mytable WHERE fieldofinterest field2) ASC; I think this will work.. SELECT *, IF(a-b < 0,a, b) as SortField FROM table WHERE whatever ORDER BY SortField Question: Is

Re: SELECT with Result Ordered by Minimum of Fields

2006-08-06 Thread Chris W
David T. Ashley wrote: Can I just write something like: SELECT * FROM mytable WHERE fieldofinterest I think this will work.. SELECT *, IF(a-b < 0,a, b) as SortField FROM table WHERE whatever ORDER BY SortField a and b being the names of the fields you are interested in. -- Chris W KE5GIX

SELECT with Result Ordered by Minimum of Fields

2006-08-05 Thread David T. Ashley
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