I need to do all the normal SQL stuff (SELECT,WHERE,ORDER BY)
on the elements of an array field.
I can not alter the schema, and the number of elements are
variable.
How do I do this?
table: name, data
"nameA",{"data1","data2"}
"nameB",{"data2","data3","data4"}
"nameC",{"data5"}
SELECT name, ?data? FROM table WHERE ?data? LIKE "data1" OR ?data? LIKE
"data2";
results=
nameA, data1
nameA, data2
nameB, data2
I am using PostgreSQL and PHP (the output is HTML).
I can get all the data, then pars it in php but that seems
like a wast of SQL, and impractical with any large number of records.
I would like to do it with as much SQL and little php as posible.
If this is a RTFM type question please tell me where in what M
to R.
Thank you.