Home > database >  Mysql json array values, the problem of query
Mysql json array values, the problem of query

Time:09-23

The data table

Id uid info
1 1001 {" name ":" anniversary ", "status" : 0, "addtime" : "2017-10-10"}
2, 1002 [{" name ":" anniversary ", "status" : 0, "addtime" : "2017-10-11"}, {" name ":" no sales ", "status" : 0, "addtime" : "2017-10-12"}]
3, 1003 [{" name ":" no sales ", "status" : 0, "addtime" : "2017-10-12"}, {" name ":" National Day promotion ", "status" : 0, "addtime" : "2017-09-28"}] special
I want to check at the same time took part in the anniversary and sale promotion of the user's uid, should how to write the query?

CodePudding user response:

Select the uid from the name of the table where (info like '% % anniversary and info like' % sales %)

CodePudding user response:

Data of the info in the hive format for json array, not directly use the like match
  • Related