Re: [sqlite] splitting field data

2008-06-18 Thread cmartin
On Wed, 18 Jun 2008, P Kishor wrote: >> CREATE TABLE foo (ID INTEGER PRIMARY KEY, ITEMS); >> INSERT INTO foo VALUES(1,item1;item2;item3); >> INSERT INTO foo VALUES(2,item1;item4); >> INSERT INTO foo VALUES(3,item5;item3;item7); > > The above is incorrect SQL. If you run the above INSERT comma

Re: [sqlite] splitting field data

2008-06-18 Thread P Kishor
On 6/17/08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I have a table that contains 2 fields: ID, ITEMS, as: > > CREATE TABLE foo (ID INTEGER PRIMARY KEY, ITEMS); > INSERT INTO foo VALUES(1,item1;item2;item3); > INSERT INTO foo VALUES(2,item1;item4); > INSERT INTO foo VALUES(3,item5;item3;i

Re: [sqlite] splitting field data

2008-06-18 Thread cmartin
On Tue, 17 Jun 2008, Rich Shepard wrote: > You ought to normalize your data. Consider (and this is just off the top > of my head) two tables: one to hold categories and their descriptions, the > other to hold categories and items. Then you can select either specific > items, all items, or group

Re: [sqlite] splitting field data

2008-06-17 Thread Rich Shepard
On Tue, 17 Jun 2008, [EMAIL PROTECTED] wrote: > As shown, ITEMS is comprised of individual data items separated by > semicolons. For some purposes, this concatenated form suits the purpose, > but for other purposes I need to split these items into individual data > points. That is, I want to split

[sqlite] splitting field data

2008-06-17 Thread cmartin
I have a table that contains 2 fields: ID, ITEMS, as: CREATE TABLE foo (ID INTEGER PRIMARY KEY, ITEMS); INSERT INTO foo VALUES(1,item1;item2;item3); INSERT INTO foo VALUES(2,item1;item4); INSERT INTO foo VALUES(3,item5;item3;item7); As shown, ITEMS is comprised of individual data items separated