Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Select state by json
#MySQL 5.7.12 #please drop objects you've created at the end of the script #or check for their existance before creating #'\\' is a delimiter create table if not exists states ( name varchar(32), data JSON ); drop table states; create table if not exists states ( name varchar(32), data JSON ); insert into states values ('STATE1', '{"chat_verification": {"token": "abc123"}, "whatever" : true}'); insert into states values ('STATE2', '{"chat_verification": {"token": "xDnope"}, "whatever" : true}'); insert into states values ('STATE3', '{"chat_verification": {"token": "abcDEF"}, "whatever" : true}'); # -- https://dev.mysql.com/doc/refman/5.7/en/json-search-functions.html#function_json-contains; SELECT * FROM states WHERE data->"$.chat_verification.token" = "abc123"; drop table states;
run
|
edit
|
history
|
help
0
sree..
vwall
test
restaurants_menu
poi
test
Employee
Point System Alpha.1
test wall
Srinivas