Re: [sqlite] comma-separated string data

2014-07-17 Thread supriya1890
Hi, Say the scenario is column value = [1,2,33,45,66] u want to compare value x with the column and retrieve data then use the condition, value = 'x' OR value LIKE 'x,%' OR value LIKE '%,x,%' OR value LIKE '%,x' it should work in most of the cases (y) Thanks, Supriya -- View this message

Re: [sqlite] comma-separated string data

2014-07-17 Thread supriya1890
Hi, Say the scenario is column value = [1,2,33,45,66] u want to compare value x with the column and retrieve data then use the condition, value = 'x' OR value LIKE 'x,%' OR value LIKE '%,x,%' OR value LIKE '%,x' it should work in most of the cases (y) Thanks, Supriya -- View this message

Re: [sqlite] comma-separated string data

2014-04-07 Thread Max Vlasov
On Sun, Apr 6, 2014 at 10:23 PM, Dominique Devienne ddevie...@gmail.com wrote: If the answer to either question above is true, then a specialized vtable would be both more convenient and faster, no? Hmm... If logical peculiarity of vtable approach (when where-constrained queries might be

Re: [sqlite] comma-separated string data

2014-04-07 Thread Dominique Devienne
On Sun, Apr 6, 2014 at 8:15 PM, Dominique Devienne ddevie...@gmail.com wrote: [...]. I'd much prefer a cleaner Oracle-like TABLE() operator transforming the result array of a table-function operating on correlated values from a join as an intermediate result-set, i.e. select t.key,

Re: [sqlite] comma-separated string data

2014-04-07 Thread Petite Abeille
On Apr 7, 2014, at 3:28 PM, Dominique Devienne ddevie...@gmail.com wrote: For those interested, here's an article along the same lines that better demonstrate what I mean by the above: http://technology.amis.nl/2013/06/26/oracle-database-12c-joining-and-outer-joining-with-collections/ Aha!

Re: [sqlite] comma-separated string data

2014-04-07 Thread mm.w
Hello, Dear Petite Abeille, you may repeat it 1 times, they don't listen, they prefer adding to the previous mistake instead of fixing the origin (hiding behind falsehood constraints, like it is way it is...) until it will fall apart with unsolvable issues and developer-made-bugs, surely

Re: [sqlite] comma-separated string data

2014-04-07 Thread RSmith
On 2014/04/07 20:57, Petite Abeille wrote: Lipstick Driven Design: “You can put lipstick on a pig, but it’s still a pig.” But if the Customer can't tell the difference, does that make you a good pimp? ___ sqlite-users mailing list

Re: [sqlite] comma-separated string data

2014-04-07 Thread mm.w
But if the Customer can't tell the difference, does that make you a good pimp? Hello, you just don't get it then you don't get it, that's it. Best Regards On Mon, Apr 7, 2014 at 12:09 PM, RSmith rsm...@rsweb.co.za wrote: On 2014/04/07 20:57, Petite Abeille wrote: Lipstick Driven Design:

Re: [sqlite] comma-separated string data

2014-04-07 Thread David Simmons
Why are these people allowed to use this discussion board? Using SQLite on a critical corporation application I find that by reading the material provided it is handling terabyte databases with remarkable performance. SQLite does not have the cost associated with one like Oracle and does

Re: [sqlite] comma-separated string data

2014-04-07 Thread Petite Abeille
On Apr 8, 2014, at 1:02 AM, David Simmons dsimmons...@earthlink.net wrote: Why are these people allowed to use this discussion board? Hmmm? What we've got here is failure to communicate perhaps. ___ sqlite-users mailing list

Re: [sqlite] comma-separated string data

2014-04-07 Thread mm.w
Hello, thus, good, incident closed, we've seen worse; I guess, the misunderstanding was triggered by not following up and well on the lipstick 8-p Best. On Mon, Apr 7, 2014 at 4:27 PM, RSmith rsm...@rsweb.co.za wrote: On 2014/04/08 01:02, David Simmons wrote: Why are these people allowed

Re: [sqlite] comma-separated string data

2014-04-06 Thread Hick Gunter
Nachricht- Von: Dominique Devienne [mailto:ddevie...@gmail.com] Gesendet: Samstag, 05. April 2014 10:24 An: General Discussion of SQLite Database Betreff: Re: [sqlite] comma-separated string data On Saturday, April 5, 2014, Max Vlasov max.vla...@gmail.com wrote: On Fri, Apr 4, 2014 at 10:20 PM

Re: [sqlite] comma-separated string data

2014-04-06 Thread Dominique Devienne
On Sun, Apr 6, 2014 at 6:13 PM, Hick Gunter h...@scigames.at wrote: The vtable split method will happily accept a field from a join as in Select t.key,c.value from table t cross join cmlist on c.commalist=t.field; Thanks. Given Max's other post, I now understand that, although I'll have to

Re: [sqlite] comma-separated string data

2014-04-06 Thread Dominique Devienne
On Sat, Apr 5, 2014 at 11:46 AM, RSmith rsm...@rsweb.co.za wrote: WITH csvrec(i,l,c,r) AS ( SELECT tmpcsv.ID, 1, colCSV||',', '' FROM tmpcsv UNION ALL SELECT i, instr(c,',') AS vLen, substr(c,instr(c,',')+1) AS vRem,

Re: [sqlite] comma-separated string data

2014-04-05 Thread Max Vlasov
On Fri, Apr 4, 2014 at 10:20 PM, peter korinis kori...@earthlink.net wrote: A data column in a link table contains comma-separated string data, where How do you 'parse' a table entry like: 4,66,51,3009,2,678, . to extract these values and use them in an SQL statement, perhaps a WHERE id='66'?

Re: [sqlite] comma-separated string data

2014-04-05 Thread Dominique Devienne
On Saturday, April 5, 2014, Max Vlasov max.vla...@gmail.com wrote: On Fri, Apr 4, 2014 at 10:20 PM, peter korinis kori...@earthlink.netjavascript:; wrote: A data column in a link table contains comma-separated string data, where How do you 'parse' a table entry like: 4,66,51,3009,2,678,

Re: [sqlite] comma-separated string data

2014-04-05 Thread RSmith
CREATE TABLE tmpcsv ( ID INTEGER PRIMARY KEY, colA TEXT, colCSV TEXT ); INSERT INTO tmpcsv (colA, colCSV) VALUES ('foo', '4,66,51,3009,2,678'), ('bar', 'Sputnik,Discovery'), ('baz', '101,I-95,104'); WITH csvrec(i,l,c,r) AS ( SELECT tmpcsv.ID, 1, colCSV||',', '' FROM tmpcsv

Re: [sqlite] comma-separated string data

2014-04-04 Thread Robert Hairgrove
You need to normalize the database design. -- On Fri, 2014-04-04 at 14:20 -0400, peter korinis wrote: A data column in a link table contains comma-separated string data, where each value represents a value to link to another table. (many-to-many relationship) How do you 'parse' a

[sqlite] comma-separated string data

2014-04-04 Thread peter korinis
A data column in a link table contains comma-separated string data, where each value represents a value to link to another table. (many-to-many relationship) How do you 'parse' a table entry like: 4,66,51,3009,2,678, . to extract these values and use them in an SQL statement, perhaps a WHERE

Re: [sqlite] comma-separated string data

2014-04-04 Thread Clemens Ladisch
peter korinis wrote: A data column in a link table contains comma-separated string data, where each value represents a value to link to another table. (many-to-many relationship) Every time you use non-normalized data ... God kills a kitten. How do you 'parse' a table entry like:

Re: [sqlite] comma-separated string data

2014-04-04 Thread James K. Lowden
On Fri, 4 Apr 2014 14:20:57 -0400 peter korinis kori...@earthlink.net wrote: How do you 'parse' a table entry like: 4,66,51,3009,2,678, . to extract these values and use them in an SQL statement, perhaps a WHERE id='66'? http://www.schemamania.org/sql/#lists HTH, really. --jkl