Re: finding count of spaces in a string

2007-09-04 Thread dpgirago
> [EMAIL PROTECTED] wrote: >> We have numerous identical tables with a varchar column that holds data >> like this: "0 0 0 1 0 1 0 25 7 0 139 0 9". Essentially there are a bunch >> of integers with a single space as a separator. There _should_ be no more >> than 30 entries ( and 29 spaces ),

Re: finding count of spaces in a string

2007-09-04 Thread Francesco Riosa
[EMAIL PROTECTED] ha scritto: > We have numerous identical tables with a varchar column that holds data > like this: "0 0 0 1 0 1 0 25 7 0 139 0 9". Essentially there are a bunch > of integers with a single space as a separator. There _should_ be no more > than 30 entries ( and 29 spaces ), but

Re: finding count of spaces in a string

2007-09-04 Thread Rolando Edwards
Try this: mysql> SELECT LENGTH('0 0 0 1 0 1 0 25 7 0 139 0 9') - LENGTH(REPLACE('0 0 0 1 0 1 0 25 7 0 139 0 9',' ','')) + 1; +-+ | LENGTH('0 0 0 1 0 1 0 25 7 0 139 0 9') - LENGTH(REPLACE('0 0 0 1 0

Re: finding count of spaces in a string

2007-09-04 Thread Jay Pipes
[EMAIL PROTECTED] wrote: We have numerous identical tables with a varchar column that holds data like this: "0 0 0 1 0 1 0 25 7 0 139 0 9". Essentially there are a bunch of integers with a single space as a separator. There _should_ be no more than 30 entries ( and 29 spaces ), but sometimes th

Re: finding count of spaces in a string

2007-09-04 Thread Baron Schwartz
Hi, [EMAIL PROTECTED] wrote: We have numerous identical tables with a varchar column that holds data like this: "0 0 0 1 0 1 0 25 7 0 139 0 9". Essentially there are a bunch of integers with a single space as a separator. There _should_ be no more than 30 entries ( and 29 spaces ), but sometim