1

In a mysql table I have, I want to select all the rows and all the columns, but by ordering them by the difference between the values of two values of the same column. Is there a way to write such an SQL query? Thank you very much!

  • 7
    could you expand on `difference between the values of two values of the same column`? How do you know which to compare? – abhinav Nov 24 '11 at 06:02

1 Answers1

0
SELECT * FROM MyTable ORDER BY (ColumnA - ColumnB)
Dylan Smith
  • 22,069
  • 2
  • 47
  • 62