Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
MySQL JSON_SEARCH boolean Issue
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 superheroes ( name varchar(32), attributes JSON ); insert into superheroes values ('Batman', '{"dead": "false", "orphan": true, "billionaire": "true", "goodboy" : "true"}'); SELECT JSON_SEARCH(attributes, 'all', 'true') FROM superheroes WHERE name = 'Batman'; drop table superheroes;
absolute service time: 0,42 sec
edit mode
|
history
|
discussion
JSON_SEARCH(attributes, 'all', 'true')
1
["$.goodboy", "$.billionaire"]