Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
IN statement in SQL doesn’t accept a wild character (SAP)
Note that IN statement in SQL doesn’t accept a wild character. You have to use OR/AND to make it work as mentioned below:
select *
from Test1 t INNER JOIN Test2 s ON t.ID = s.RID
where t.sdate >= ?1
AND t.edate <= ?2
AND t.id LIKE ?3
AND ('%' = ?4 OR t.afdeling IN (?4))
AND ('%' = ?5 OR s.sid IN (?5))
ORDER BY ID DESC
In case you are using parameter position to pass parameters, try changing it as below:
AND ('%' = ?4 OR t.afdeling IN (?5))
AND ('%' = ?6 OR s.sid IN (?7))Advertisements