Skip to main content
The 2026 Annual Developer Survey is live— take the Survey today!

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • 1
    conditional ordering is done with CASE Commented Apr 10, 2017 at 11:37
  • 1
    smth like order by flag,case when flag then date end desc, case when not flag then date end asc rextester.com/FDAY76293 Commented Apr 10, 2017 at 11:40

lang-sql