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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

-- to get only records with characters

Status
Not open for further replies.

r9ronaldo

Programmer
Jun 19, 2003
28
US
Hi All,

This might be pretty basic, Say like I have a field type VARCHAR(10),

Couple of records were just numbers and some records have Characters in them,

How I can write a simple query to get only those records which have characters in them ( Not the ones with pure numbers )

Thank You all,

R9

Forza Inter

Forza Nerazzuri
 
Forza,

Here are some sample data:
Code:
SQL> select * from tt_forza;

STRING
----------
012345
01234ABC
ABCDEFG

abcDE#$123

5 rows selected.
Here is my solution (presuming that you also do not wish to see NULL entries):
Code:
select * from tt_forza where length(translate(string,'^0123456789','^'))>0;

STRING
----------
01234ABC
ABCDEFG
abcDE#$123

3 rows selected.
[santa]Mufasa
(aka Dave of Sandy, Utah, USA @ 17:35 (26May04) UTC (aka "GMT" and "Zulu"), 10:35 (26May04) Mountain Time)
 

Thank You Santa Mufasa

That Helped a lot

Thank you Once again


R9
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top