Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find All Rows Where a Column's Entry Is greater than a specific size

Status
Not open for further replies.

mateobus

Programmer
Aug 20, 2007
28
US
Hey,

I have a table called MyTable with a Column called Name which is varchar(50). I would like to write a select statement to get the rows from MyTable where the Name column is greater than 5 characters. So it would select 'blah blah' but not 'blah'. Thanks in advance.
 
SELECT * FROM MYTABLE WHERE LEN(RTRIM(NAME))>5;

The RTRIM will remove blanks on the end.

djj
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top