Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003

    Unanswered: order by field options

    I'm trying to make a mysql query work in mssql, but my problem is that I can't find any function in mssql that is comparable to the field() function in mysql. I'm using the function as follows...

    SELECT Index from table WHERE Index IN (arrayofindices) ORDER BY FIELD(Index, arrayofindices)

    any suggestions?

  2. #2
    Join Date
    Sep 2003
    This is how it works in Oracle, you can always try it.

    SELECT Index
    FROM table
    WHERE Index IN (arrayofindices)
    ORDER BY Index, arrayofindices;
    A good programmer is a LAZY programmer!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts