Re: Check if column is substring of another column

From: Richard Huxton <dev(at)archonet(dot)com>
To: Keaton Adams <kadams(at)mxlogic(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Check if column is substring of another column
Date: 2009-01-22 07:49:52
Message-ID: 49782520.2000305@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Keaton Adams wrote:
> PostgreSQL 8.1 question:
>
> I have two columns.
> policyNumber contains a 12-13 varchar string
> AllPolicyNumbersIncluded contains one or more 12-13 varchar strings (policy nums) separated by commas

Rodrigo has given a direct answer, but you might want to consider either
an array of text for AllPolicyNumbersIncluded or better still a join to
another table. That will make your queries more natural.

--
Richard Huxton
Archonet Ltd

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Igor Katson 2009-01-22 08:09:52 Re: [Plproxy-users] A complex plproxy query
Previous Message Abdul Rahman 2009-01-22 07:15:07 Re: autovacuum daemon