Search Postgresql Archives

Regular expression and array

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I wont go into details about why im using this field as an array but
how would I select all the rows that have the first name 'Tom' out of
the 'names' field?

CREATE TABLE test (
    id integer,
    names character varying[]
);
INSERT INTO test VALUES (1, '{"''Josh Berkus''","''Peter
Eisentraut''","''Marc Fournier''"}');
INSERT INTO test VALUES (2, '{"''Tom Lane''","''Bruce
Momjian''","''Dave Page''"}');
INSERT INTO test VALUES (3, '{"''Jan Wieck''","''Oleg
Bartunov''","''Joe Conway''"}');

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux