MYSQL select a piece of a string and order by that piece

前端 未结 4 1318
生来不讨喜
生来不讨喜 2020-12-03 18:24

I have a field with this kind of info \"web-1/1.,web-2/2.,web-3/3.,web-4/4.,web-5/5.\". Other registers could have different values like \"web-1/4.,web-2/5.,web-3/1.,web-4/

4条回答
  •  离开以前
    2020-12-03 18:50

    I would do this

    SELECT info
    FROM table
    WHERE info LIKE 'web-2%'
    ORDER BY info ASC
    

提交回复
热议问题