with temp(name) as (select 'abc' from dual
union select '123abc' from dual
union select '1abc3' from dual)
select * from temp where temp.name like '%[a-z]%'
why i am not able to get all the 3 records in output , I am using Oracle SQL Developer 11g
Reason why i am using this query is : I want to check if Desired column Contains only String no Number and Special Character
SQL Server CHARINDEX() Function The CHARINDEX() function searches for a substring in a string, and returns the position. If the substring is not found, this function returns 0. Note: This function performs a case-insensitive search.
You can use RegEx in many languages like PHP, Python, and also SQL. RegEx lets you match patterns by character class (like all letters, or just vowels, or all digits), between alternatives, and other really flexible options.
You are mixing SQL Server and Oracle syntax:
SQL SERVER Demo:
with temp(name) as (
select 'abc' union all select '123abc' union select '1abc3'
)
select * from temp where temp.name like '%[a-z]%';
-- [] is T-SQL specific
ORACLE Demo:
with temp(name) as (select 'abc' from dual
union select '123abc' from dual
union select '1abc3' from dual)
select * from temp where regexp_like(temp.name, '[a-z]')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With