Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. SQL Server
  3. Question
SQL Server

How can like be selected with multiple values in SQL?

Asked by Dhananjay Singh Sep 14, 2023 957 views 1 answer
Share

About this question

 I intend to select multiple values using the SQL query below. But I want to do this by using this like an operator. 

SELECT top 1 employee_id, employee_ident, utc_dt, rx_dt 

Here is another SQL query from the table employee. 

ON         employee.ident=employee_mdata_history.employee_ident 

WHERE      employee_id like 'emp1%' , 'emp3%' 

ORDER BY   rx_dt desc

The data table has many data like ‘emp1’ and ‘emp3’, etc. Can I filter the result by top 3 ‘emp1’ and top 2 ‘emp3’, depending on the rx_dt? 

Your answer

1 Answer

More SQL Server discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest SQL Server Blogs

Guides, tips and career advice on SQL Server from JanBask experts.