dtyrxmoj20617 2018-01-29 10:14
浏览 98
已采纳

如何在Mysql中检查数组中的列

Sorry if the topic name is not reasonable.

I have a column in mySql with value (10,11,12), it's a string, like this

And I have an array to check, how can select this row if array contains any one value 10, 11 or 12. For example:

array(3,4,11) - choose
array(5,6,7) - not choose
array(11,8,10) - choose

Thank you!

  • 写回答

1条回答 默认 最新

  • dsizd368332 2018-01-29 10:20
    关注

    Here is the query :

    SELECT *
    FROM your_table
    WHERE FIND_IN_SET(10, custom_categories) 
          OR FIND_IN_SET(11, custom_categories) 
          OR FIND_IN_SET(12, custom_categories);
    

    For More Detail : Read

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置