Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Microsoft SQL Server > Re: using LEN t...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 2 Topic 10992 of 11422
Post > Topic >>

Re: using LEN to find a first word greater than 17

by "Plamen Ratchev" <Plamen@[EMAIL PROTECTED] > Apr 23, 2008 at 09:22 AM

This is SQL Server newsgroup, so here is how you can do it in SQL Server. 
For Oracle you have to check the Oracle newsgroups.

CREATE TABLE Foo (
 keycol INT PRIMARY KEY,
 businessname VARCHAR(50));

INSERT INTO Foo VALUES(1, 'Tools');
INSERT INTO Foo VALUES(2, 'Someverylongbusinessname Inc.');
INSERT INTO Foo VALUES(3, 'Short Inc.');
INSERT INTO Foo VALUES(4, 'Anotherverylongbusinessname');

SELECT businessname
FROM Foo
WHERE CHARINDEX(' ', businessname + ' ') > 18;

HTH,

Plamen Ratchev
http://www.SQLStudio.com
 




 2 Posts in Topic:
using LEN to find a first word greater than 17
ciojr@[EMAIL PROTECTED]   2008-04-23 06:02:23 
Re: using LEN to find a first word greater than 17
"Plamen Ratchev"  2008-04-23 09:22:03 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Oct 12 21:01:34 CDT 2008.