Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Select state by json
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
#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;
absolute service time: 0,38 sec
fork mode
|
history
|
discussion
name
data
1
STATE1
{"whatever": true, "chat_verification": {"token": "abc123"}}