doufangzhang4454 2014-02-18 17:59
浏览 13

订购MySQL结果BY日期,也使用LIKE

I have this table request with columns

request_id | users_ids | created

I need to get the results order by created, but get first the ones where user id do not exist inside users_ids.

Do i use something like FIELD() and NOT LIKE?

How do i do this?

  • 写回答

3条回答 默认 最新

  • doukun0888 2014-02-18 18:04
    关注
    ORDER BY IF(FIND_IN_SET('111', user_ids)>0,1,0),created
    

    Where '111' is your user id. But, as Marc pointed in the comment to your question - you should avoid this by altering your schema design.

    评论

报告相同问题?

悬赏问题

  • ¥15 smptlib使用465端口发送邮件失败
  • ¥200 总是报错,能帮助用python实现程序实现高斯正反算吗?有偿
  • ¥15 对于squad数据集的基于bert模型的微调
  • ¥15 为什么我运行这个网络会出现以下报错?CRNN神经网络
  • ¥20 steam下载游戏占用内存
  • ¥15 CST保存项目时失败
  • ¥15 树莓派5怎么用camera module 3啊
  • ¥20 java在应用程序里获取不到扬声器设备
  • ¥15 echarts动画效果的问题,请帮我添加一个动画。不要机器人回答。
  • ¥15 Attention is all you need 的代码运行