@Status int
from page i am passing id 0,1,2
Table data is saved as 0,1 and type is int
where condition if 0 is passed from page -data will get status=0
where condition if 1 is passed from page -data will get status=1
where condition if 2 is passed from page -data will get status=0,1 .how to get all record by passing 2 from page
Abhishek ChadhaPosted May 20, 2024, 5:49 PM
To achieve the desired behavior where passing
2from the page retrieves records withstatus=0orstatus=1, you can use a SQL query with conditional logic. Here's how you can implement it::idis the parameter passed from the pageThis query structure allows you to handle each condition based on the value of
:id. When:idis2, it retrieves all records without any condition onyour_column.