0

I need to order the results by how the values in IN() clause are set up, here is the example code.

SELECT nickname, age WHERE id IN(3, 1, 2) ORDER BY ?; <- this is where I need the results go back according to the IN() clause

This the result as of now, (using PHPmyadmin, not yet php coded).

nickname | age | true id of the row
j        | 11  | 1
jj       | 22  | 2
jjj      | 33  | 3

The result that I need is:

nickname | age | true id of the row
jjj      | 33  | 3
j        | 11  | 1
jj       | 22  | 2

Can I do this with using IN() clause? This is the only idea that I came up with so if you have any idea/s that I may try then please tell me.

Dumb Question
  • 365
  • 1
  • 3
  • 14

0 Answers0