clear markdown compare help donate or buy diddy dollings comments/suggestions/bugs a leap of faith? bible365
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 756632 fiddles created (13593 in the last week).

select version();
version()
10.4.7-MariaDB-1:10.4.7+maria~buster
 hidden batch(es)


create table myjson(data json);
 hidden batch(es)


insert into myjson values ('{"foo": "bar"}'); insert into myjson values ('"bar"');
 hidden batch(es)


select * from myjson where json_extract(data, '$.foo') = json_extract('"bar"', '$');
data
 hidden batch(es)


select * from myjson where json_extract(data, '$.foo') = json_unquote(json_extract('"bar"', '$'));
data
{"foo": "bar"}
 hidden batch(es)


select * from myjson where json_unquote(json_extract(data, '$.foo')) = json_extract('"bar"', '$');
data
 hidden batch(es)


select * from myjson where json_unquote(json_extract(data, '$.foo')) = json_unquote(json_extract('"bar"', '$'));
data
{"foo": "bar"}
 hidden batch(es)


select * from myjson where json_extract(data, '$') = 'bar';
data
"bar"
 hidden batch(es)


select * from myjson where json_unquote(json_extract(data, '$')) = 'bar';
data
"bar"
 hidden batch(es)


select json_extract('"bar"', '$');
json_extract('"bar"', '$')
"bar"
 hidden batch(es)


select json_unquote(json_extract('"bar"', '$'));
json_unquote(json_extract('"bar"', '$'))
bar
 hidden batch(es)


select json_extract('{"foo": "bar"}', '$.foo');
json_extract('{"foo": "bar"}', '$.foo')
"bar"
 hidden batch(es)


select json_unquote(json_extract('{"foo": "bar"}', '$.foo'));
json_unquote(json_extract('{"foo": "bar"}', '$.foo'))
bar
 hidden batch(es)


select json_extract('{"foo": "bar"}', '$.foo') = json_extract('{"foo": "bar"}', '$.foo');
json_extract('{"foo": "bar"}', '$.foo') = json_extract('{"foo": "bar"}', '$.foo')
0
 hidden batch(es)


select json_unquote(json_extract('{"foo": "bar"}', '$.foo')) = json_unquote(json_extract('{"foo": "bar"}', '$.foo'));
json_unquote(json_extract('{"foo": "bar"}', '$.foo')) = json_unquote(json_extract('{"foo": "bar"}', '$.foo'))
1
 hidden batch(es)


select json_extract('{"foo": "bar"}', '$.foo') = json_unquote(json_extract('{"foo": "bar"}', '$.foo'));
json_extract('{"foo": "bar"}', '$.foo') = json_unquote(json_extract('{"foo": "bar"}', '$.foo'))
0
 hidden batch(es)


select json_unquote(json_extract('{"foo": "bar"}', '$.foo')) = json_extract('{"foo": "bar"}', '$.foo');
json_unquote(json_extract('{"foo": "bar"}', '$.foo')) = json_extract('{"foo": "bar"}', '$.foo')
0
 hidden batch(es)


select json_extract('{"foo": "bar"}', '$.foo') = json_unquote(json_extract('"bar"', '$'));
json_extract('{"foo": "bar"}', '$.foo') = json_unquote(json_extract('"bar"', '$'))
0
 hidden batch(es)


# If the above is false, then how come this yields a result? select * from myjson where json_extract(data, '$.foo') = json_unquote(json_extract('"bar"', '$'));
data
{"foo": "bar"}
 hidden batch(es)