dbTalk Databases Forums  

find word greater than 17

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss find word greater than 17 in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
ciojr@yahoo.com
 
Posts: n/a

Default find word greater than 17 - 04-23-2008 , 09:40 AM






i am looking to find the first word of a field greater than 17

select businessname
from tablename
where
CHAR(' ', businessname + ' ') > 17

Reply With Quote
  #2  
Old   
Peter Nilsson
 
Posts: n/a

Default Re: find word greater than 17 - 04-23-2008 , 09:58 PM






ci... (AT) yahoo (DOT) com wrote:
Quote:
i am looking to find the first word of a field greater than 17
Some data examples would be useful.

Quote:
select businessname
from tablename
where
CHAR(' ', businessname + ' ') > 17
-- field length > 17
where length(trim(businessname)) > 17

or...

-- has any (space delimited) word of length > 17
select regexp_substr(businessname, '[^[:space:]]{18,}')
from tablename
where regexp_like(businessname, '[^[:space:]]{18,}')

or...

-- first (space delimited) word has length > 17
select regexp_substr(businessname, '[^[:space:]]{18,}')
from tablename
where regexp_like(businessname, '^[^[:space:]]{18,}')

--
Peter


Reply With Quote
  #3  
Old   
Peter Nilsson
 
Posts: n/a

Default Re: find word greater than 17 - 04-23-2008 , 09:58 PM



ci... (AT) yahoo (DOT) com wrote:
Quote:
i am looking to find the first word of a field greater than 17
Some data examples would be useful.

Quote:
select businessname
from tablename
where
CHAR(' ', businessname + ' ') > 17
-- field length > 17
where length(trim(businessname)) > 17

or...

-- has any (space delimited) word of length > 17
select regexp_substr(businessname, '[^[:space:]]{18,}')
from tablename
where regexp_like(businessname, '[^[:space:]]{18,}')

or...

-- first (space delimited) word has length > 17
select regexp_substr(businessname, '[^[:space:]]{18,}')
from tablename
where regexp_like(businessname, '^[^[:space:]]{18,}')

--
Peter


Reply With Quote
  #4  
Old   
Peter Nilsson
 
Posts: n/a

Default Re: find word greater than 17 - 04-23-2008 , 09:58 PM



ci... (AT) yahoo (DOT) com wrote:
Quote:
i am looking to find the first word of a field greater than 17
Some data examples would be useful.

Quote:
select businessname
from tablename
where
CHAR(' ', businessname + ' ') > 17
-- field length > 17
where length(trim(businessname)) > 17

or...

-- has any (space delimited) word of length > 17
select regexp_substr(businessname, '[^[:space:]]{18,}')
from tablename
where regexp_like(businessname, '[^[:space:]]{18,}')

or...

-- first (space delimited) word has length > 17
select regexp_substr(businessname, '[^[:space:]]{18,}')
from tablename
where regexp_like(businessname, '^[^[:space:]]{18,}')

--
Peter


Reply With Quote
  #5  
Old   
Peter Nilsson
 
Posts: n/a

Default Re: find word greater than 17 - 04-23-2008 , 09:58 PM



ci... (AT) yahoo (DOT) com wrote:
Quote:
i am looking to find the first word of a field greater than 17
Some data examples would be useful.

Quote:
select businessname
from tablename
where
CHAR(' ', businessname + ' ') > 17
-- field length > 17
where length(trim(businessname)) > 17

or...

-- has any (space delimited) word of length > 17
select regexp_substr(businessname, '[^[:space:]]{18,}')
from tablename
where regexp_like(businessname, '[^[:space:]]{18,}')

or...

-- first (space delimited) word has length > 17
select regexp_substr(businessname, '[^[:space:]]{18,}')
from tablename
where regexp_like(businessname, '^[^[:space:]]{18,}')

--
Peter


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.