Answers for "like query with multiple values in sql"

SQL
1

multiple like in sql

SELECT * FROM my_table WHERE (colA LIKE '%hello%' OR colB LIKE '%world%');
Posted by: Guest on May-24-2021
0

put multiple value in a like sql

SELECT
  x.*
FROM
  (
    VALUES
      ('emp1%', 3),
      ('emp3%', 2)
  ) AS v (pattern, row_count)
  CROSS APPLY
  (  -- your query
    SELECT top (v.row_count)
               employee_id, employee_ident, utc_dt, rx_dt 
    FROM       employee
    INNER JOIN employee_mdata_history
    ON         employee.ident=employee_mdata_history.employee_ident 
    WHERE      employee_id like v.pattern
    ORDER BY   rx_dt desc
  ) AS x
;
Posted by: Guest on April-18-2021

Code answers related to "like query with multiple values in sql"

Code answers related to "SQL"

Browse Popular Code Answers by Language