View previous topic :: View next topic
|
Author |
Message |
MCEVOY
New User
Joined: 21 Nov 2005 Posts: 18
|
|
|
|
I have to list all rows in a table that have values in a CHAR(10) column containing any character that is not alphanumeric.
Any bright ideas on how to code this in a Select Statement, or am I missing/forgetting something basic? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
as soon as you tell us what is NOT alphanumeric, a solution maybe forthcoming. |
|
Back to top |
|
|
MCEVOY
New User
Joined: 21 Nov 2005 Posts: 18
|
|
|
|
Anything other than the latters A-Z and the numbers 0-9.
Thanks for your interest. |
|
Back to top |
|
|
ashimer
Active Member
Joined: 13 Feb 2004 Posts: 551 Location: Bangalore
|
|
|
|
Code: |
SELECT COL FROM
(
SELECT COL,
CASE TRANSLATE(UPPER(COL), ' ','ABCDEFGHIJKLMNOPQRSTUVWXYZ') = ' '
THEN 1
ELSE 0
END AS VAL
FROM TABLE
) AS TEMP
WHERE VAL = 1 ;
|
this will give you only those values which are in range A - Z ... |
|
Back to top |
|
|
ashimer
Active Member
Joined: 13 Feb 2004 Posts: 551 Location: Bangalore
|
|
|
|
Oops .. i missunderstud your last post ... do the changes accordingly .. |
|
Back to top |
|
|
MCEVOY
New User
Joined: 21 Nov 2005 Posts: 18
|
|
|
|
Brilliant. I get the idea.
Thanks a million. |
|
Back to top |
|
|
|