MYSQL ORDER BY CASE Issue

前端 未结 3 1066
囚心锁ツ
囚心锁ツ 2020-11-27 21:44

I have a database like this:

-------------------------------------------------------------------
|   id_one   |   id_two   |   timestamp_one   |   timestamp_         


        
3条回答
  •  执念已碎
    2020-11-27 22:10

    SELECT * FROM tablename 
    WHERE id_one=27 OR id_two=27 
    ORDER BY id ASC, timestamp_one DESC
    

提交回复
热议问题