表结构如下

MySQL对某个字段是json的查询

想对exec_rule_value里的json进行查询,SQL如下:

SELECT * FROM purchaser_rule_config where exec_rule_value -> '$.order_receive_remind.value' = '1';

以下部分内容转载自:https://blog.csdn.net/Code_shadow/article/details/100055002

如果是Mybatis框架,要把 > 符号转义,像这样用 <![CDATA[ ]]>

<![CDATA[   exec_rule_value -> '$.order_receive_remind.value' < #{endDate,jdbcType=VARCHAR} ]]>

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-21
  • 2022-02-13
猜你喜欢
  • 2022-12-23
  • 2021-07-02
  • 2021-06-24
  • 2022-12-23
  • 2022-02-04
  • 2022-12-23
  • 2021-12-04
相关资源
相似解决方案