数据库
首页 > 数据库> > mysql 查询json字符串条件

mysql 查询json字符串条件

作者:互联网

SELECT DATEDIFF(JSON_UNQUOTE(JSON_EXTRACT(content,'$.departuretime')),NOW()) AS daysnum,id,content->'$.title' AS title
FROM tablename
WHERE `type` = 2 
AND (DATEDIFF(JSON_UNQUOTE(JSON_EXTRACT(content,'$.departuretime')),NOW())+ JSON_UNQUOTE(JSON_EXTRACT(content,'$.plandays'))) >-1

;

标签:UNQUOTE,departuretime,DATEDIFF,JSON,content,json,mysql,字符串,EXTRACT
来源: https://www.cnblogs.com/xuandi/p/15331170.html