Re: splitting a string into columns
Date: Fri, 2 May 2008 13:28:03 -0700 (PDT)
On May 2, 8:18 am, kes <abi..._at_gmail.com> wrote:
> > > Alex
> > Why does this require a stored procedure and where's the pivot?
> > --
> Thank you for following up.
> The csv1 and csv2 columns are a format for RNA sequences that have
> been modified. This is why these CSV values are stored in the
> database, it's usually been sufficient for our needs over the past 2
> years. Now people want to see the different individual values.
> e.g., xA,yG,U,G,xG
> would be stored as value csv1, now people would like to see, is there
> a correlation between U in the third location and this RNA sequence's
> the reason for the pivot is I could use level in a select statement to
> 1, xA
> 2, yG
> 3, U
> 4, G
> 5, xG
> then pivot it to
> id, csv1_1, csv1_2, csv1_3, csv1_4, csv1_5
> 3, xA, yG, U, G, xG
> using dynamic SQL and decode.
> I was just hoping for a more elegant solution.
You are changing the attributes defined within the relation, so normally you would create a new table normalized to your new definition. Whether that is reasonable for your situation depends on how much data you have, the updating it goes through, and what else you want to do with it. There might be some other DW type considerations, too.
-- @home.com is bogus. Depraved hackers! http://www.signonsandiego.com/uniontrib/20080502/news_1m2rbhack.htmlReceived on Fri May 02 2008 - 15:28:03 CDT