Skip to main content

numeric wildcard

  • January 26, 2017
  • 1 reply
  • 3 views

Daniel_Chan

What is the syntax for numeric wildcards in a LIKE statement? I know in SQL the syntax would be

 

LIKE '[0-9][0-9][0-9]'

 

But I cannot find anything in the documentation with this information.

1 reply

Adrian_Oprea_1
Forum|alt.badge.img+1
  • Participating Frequently
  • January 26, 2017

Hi ,

 

You have REGEXP_LIKE().

 

Examples of using it:

CREATE TABLE tbl1 (name VARCHAR);
insert into tbl1 values ('aaa1#2');
insert into tbl1 values ('1');

-- look for values with Numbers in
select * from tbl1 where REGEXP_LIKE(name, '\d');
name
1
aaa1#2

There are more examples at this link in the Vertica Offical docs

https://my.vertica.com/docs/7.1.x/HTML/Content/Authoring/SQLReferenceManual/Functions/RegularExpressions/REGEXP_LIKE.htm