Guest User

Untitled

a guest
May 17th, 2018
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. SELECT COUNT(id) as matches
  2. FROM my_table
  3. WHERE my_table.settings = '{ "color": "red", "location": "Australia", "flavour": "cheese" }'
  4.  
  5. SELECT COUNT(id) as matches
  6. FROM my_table
  7. WHERE
  8. JSON_EXTRACT(`settings` , '$.color') = "red"
  9. AND JSON_EXTRACT(`settings` , '$.location') = "Australia"
  10. AND JSON_EXTRACT(`setting`, '$.flavour') = "cheese";
Add Comment
Please, Sign In to add comment