0
SQL LIKE
SELECT * FROM employees WHERE Salary LIKE '3%' OR Salary LIKE '4%' OR Salary LIKE '5%'; How exactly to simplify this using IN instead of OR? I did try the following but I unfortunately failed: SELECT* FROM employees WHERE Salary LIKE IN ('3%', '4%', '5%'); Also, I even swapped LIKE and IN, but still failed :(. plz help, thanks :D
4 Respuestas
+ 3
select * from employees
where salary like'[345]%';
this is right answer
+ 2
"There is no combination of LIKE & IN in SQL, much less in TSQL (SQL Server) or PLSQL (Oracle). Part of the reason for that is because Full Text Search (FTS) is the recommended alternative."
(Source: Stackowerflow)
+ 2
its called wild cards visit www.w3schools.com for learning sql iy gives best education online as they have options to try sql online by giving right examples
0
select *
from employees
where substring(salary,1,1) in ('3','4','5');