Start a new topic

Last character of a varchar2 is a letter

[This topic is migrated from our old forums. The original author name has been removed]

Hi!! I have a varchar2 type variable that the first characters are numbers but the last one can be a character. I need to be able to select only those records that the last character is a letter. How I do that!?

[This reply is migrated from our old forums. The original author name has been removed]

Re: Last character of a varchar2 is a letter
Well, I worked it around with this where substr(TRIM(PRC_CD),-1) not in ('0','1','2','3','4','5','6','7','8','9') It may be a better way to do it.
[This reply is migrated from our old forums.]

Re: Last character of a varchar2 is a letter
Hi Elaine, It depends on which database you use. Some, for instance, support regular expressions for conditions like this. Either way, this is a question about SQL for a specific database and not a question about DbVisualizer so I'm afraid you need to find help somewhere else, e.g. in a forum for the database you use. Best Regards, Hans
[This reply is migrated from our old forums. The original author name has been removed]

Re: Last character of a varchar2 is a letter
I posted the solution I did in case someone need it. Maybe there is a better way to do it, but at least I could do what need for work.