I am fighting with a sql query for the past 1 day. My requirement is like I want to get the values from user and have to pass my query
select * from table1 where column1 like '%healt%'
But how to use the same query when we are passing the variable from client side or UI side?
I tried the query by using ?,@., like given below
select * from table where column like '%' ?'%'
but nothing worked. And nother issue I am facing with is using the OR operator.
When I am going with search criteria I want to display results by giving value to any one of the field. But in sql it is asking for all the columns which I am passing.
select * from table1 where column1 like ? OR cloumn2 like ?
But in the above SQL server is asking me to pass the value for both column1 and column2. what changes I want to make to get results by passing any one of the column?
Kindly Help me in solving this issue.