| From: | Joseph S <jks(at)selectacast(dot)net> |
|---|---|
| To: | pgsql-sql(at)postgresql(dot)org |
| Subject: | How do I search a two dimensional array? |
| Date: | 2010-03-29 22:17:11 |
| Message-ID: | hor8t7$13bo$1@news.hub.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-sql |
I can search a one dimensional array with SELECT value = ANY(array), but
how do I search two dimensional array for a particular row? ANY seems
to flatten out a two dimensional array.
[local]:playpen=> select 2 = any (ARRAY[[1,7],[4,2]]);
?column?
----------
t
(1 row)
Time: 52.451 ms
[local]:playpen=> select ROW(2,7) = any (ARRAY[[1,7],[4,2]]);
ERROR: operator does not exist: record = integer
LINE 1: select ROW(2,7) = any (ARRAY[[1,7],[4,2]]);
^
HINT: No operator matches the given name and argument type(s). You
might need to add explicit type casts.
[local]:playpen=> select ROW(4,2) = any (ARRAY[[1,7],[4,2]]);
ERROR: operator does not exist: record = integer
LINE 1: select ROW(4,2) = any (ARRAY[[1,7],[4,2]]);
^
HINT: No operator matches the given name and argument type(s). You
might need to add explicit type casts.
[local]:playpen=>
[local]:playpen=>
[local]:playpen=> select ARRAY[2,7] = ANY( ARRAY[[1,7],[4,2],[6,8]]);
ERROR: operator does not exist: integer[] = integer
LINE 1: select ARRAY[2,7] = ANY( ARRAY[[1,7],[4,2],[6,8]]);
^
HINT: No operator matches the given name and argument type(s). You
might need to add explicit type casts.
[local]:playpen=> select ARRAY[1,7] = any ( ARRAY[[1,7],[4,2],[6,8]]);
ERROR: operator does not exist: integer[] = integer
LINE 1: select ARRAY[1,7] = any ( ARRAY[[1,7],[4,2],[6,8]]);
^
HINT: No operator matches the given name and argument type(s). You
might need to add explicit type casts.
[local]:playpen=>
| From | Date | Subject | |
|---|---|---|---|
| Next Message | silly sad | 2010-03-30 04:48:23 | Re: SQL Developer accessing PostgreSQL |
| Previous Message | Hiltibidal, Rob | 2010-03-29 17:22:45 | Re: SQL Developer accessing PostgreSQL |