Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

126
Views
"Contains" and "Not Contains" methods in SQL or by using Java script UDF

Can we use "Contains" and "NotContains" methods in SQL i.e., How do I check if a string or a column value is contained in another column of a table.

Problem Statement:

  1. How do I check if a string "ABC" is contained/Not contained in "Column1"
  2. How do I check if a "Column1" value is contained/Not contained in "Column2"

If not SQL can we use JavaScript UDF or any other means to make this happen?

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

CONTAINS:

Returns true if expr1 contains expr2. Both expressions must be text or binary expressions.

CONTAINS( <expr1> , <expr2> )

Examples:

SELECT * FROM tab WHERE (Colum1, 'ABC');
SELECT * FROM tab WHERE NOT (Colum1, 'ABC');

SELECT * FROM tab WHERE (Colum1, Column2);
SELECT * FROM tab WHERE NOT (Colum1, Column2);

It is worth mentioning Snowflake LIKE/ILIKE [ANY]:

SELECT *
FROM tab
WHERE Column1 LIKE ANY ('%ABC%','%XYZ%');
about 4 years ago · Juan Pablo Isaza Report

0

You can use Like operator I believe i am not sure what exactly are you looking for but here is an example below. For more details: https://www.w3schools.com/sql/sql_like.asp

select column
from [table]
where column Like %ABC%

or if you already know the values that you are looking for in a specific column then you can use in operator:

select column from [table] where column in ('ABC','XYZ')

This will give you the rows for the column, where the values are equal to either ABC or XYZ

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!