search array field?

Поиск
Список
Период
Сортировка
От mhewii@qix.net (Mark & Candice White)
Тема search array field?
Дата
Msg-id 5e09903c.0202161541.2f143753@posting.google.com
обсуждение исходный текст
Список pgsql-general
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.

В списке pgsql-general по дате отправления:

Предыдущее
От: rey4@columbia.edu (Russell Yanofsky)
Дата:
Сообщение: Re: Can PostgreSQL be used with ASP or .NET?
Следующее
От: paul
Дата:
Сообщение: VERY basic