Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
It isn't all that hard to write but I don't think the performance would be very good. I haven't tested this but it should work.
Code:
SELECT EMP_NAME , EMP_ID FROM TABLE
WHERE SUBSTR(EMP_ID,1,1) NOT IN ('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',
'0','1','2','3','4','5','6','7','8','9')
OR SUBSTR(EMP_ID,2,1) NOT IN ('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',
'0','1','2','3','4','5','6','7','8','9')
OR SUBSTR(EMP_ID,3,1) NOT IN ('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',
'0','1','2','3','4','5','6','7','8','9')
OR SUBSTR(EMP_ID,4,1) NOT IN ('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',
'0','1','2','3','4','5','6','7','8','9')
OR SUBSTR(EMP_ID,5,1) NOT IN ('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',
'0','1','2','3','4','5','6','7','8','9')
OR SUBSTR(EMP_ID,6,1) NOT IN ('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',
'0','1','2','3','4','5','6','7','8','9')
OR SUBSTR(EMP_ID,7,1) NOT IN ('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',
'0','1','2','3','4','5','6','7','8','9');
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
Phrzby Phil wrote:
You think
Quote:
NOT BETWEEN 'A' AND 'Z'
is messier than listing 26 values, along with ensuring that they are correct?
In EBCDIC between 'A' and 'Z' there are 13 characters that are not alphabetic!
There are 6 non-alphabetic characters between I and J, and 7 more between R and S.