Skip site navigation (1) Skip section navigation (2)

Re: Counting unique comma-delimited values in a text field

From: David Fetter <david(at)fetter(dot)org>
To: Brian Ghidinelli <brian(at)pukkasoft(dot)com>
Cc: SF Postgres <sfpug(at)postgresql(dot)org>
Subject: Re: Counting unique comma-delimited values in a text field
Date: 2010-09-29 18:18:11
Message-ID: 20100929181811.GB805@fetter.org (view raw or flat)
Thread:
Lists: sfpug
On Wed, Sep 29, 2010 at 10:45:25AM -0700, Brian Ghidinelli wrote:
> 
> Hi list,
> 
> I have a table where multiple values are stored in a delimited
> string field.  Values look like:

That's not a super great idea.  If you need such an interface, make it
a view on top of the underlying normalized tables you'll use to store
the actual data. :)

Whether you actually need that view or not, normalize the data, and
your queries will be a lot easier to manage.

Cheers,
David.
-- 
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david(dot)fetter(at)gmail(dot)com
iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

In response to

sfpug by date

Next:From: Josh BerkusDate: 2010-09-30 21:14:35
Subject: Re: Counting unique comma-delimited values in a text field
Previous:From: Brian GhidinelliDate: 2010-09-29 17:45:25
Subject: Counting unique comma-delimited values in a text field

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group