[thelist] searching and JSON

Nadeem Hosenbokus nadeem at nadeemh.com
Wed Sep 12 19:14:39 CDT 2012


Hi,

So if the JSON data looks something like this:
{"Foo":"Bar"},{"Foo2":"Bar2"},{"Foo3":"Bar3"} in a column called
'Table.ColumnA'

Then a query like this should work: [select ColumnA from Table where ColumnA
like '%{"Foo":%';] if you want all the records that contain the "Foo"
parameter.

Or, [select ColumnA from Table where ColumnA like '%:"Bar"}%';] to match all
the records that have a "Bar" value

Or, [select ColumnA from Table where ColumnA like '%{"Foo":"Bar"}%';] to
match all records that have the specific pair value

Using the colon and curly brackets in the like condition can help you get
the data you want.

Hope this helps.

Nadeem Hosenbokus
(230) 766 9169
www.nadeemh.com



-----Original Message-----
From: thelist-bounces at lists.evolt.org
[mailto:thelist-bounces at lists.evolt.org] On Behalf Of Bob Meetin
Sent: 13 September 2012 02:28
To: thelist at lists.evolt.org
Subject: [thelist] searching and JSON

So you're working with a table that has parameterized data stored in a JSON
formatted field.  How do you create a mysql query that matches against only
a single element/parameter in the field without matching the other stored
elements?

-Bob
-- 

* * Please support the community that supports you.  * *
http://evolt.org/help_support_evolt/

For unsubscribe and other options, including the Tip Harvester
and archives of thelist go to: http://lists.evolt.org
Workers of the Web, evolt ! 



More information about the thelist mailing list