1
Answer

select all with bit field

lejo

lejo

1y
480
1

 IsActive field is bit

table data will be 0 0r 1 

in page All -2,Active=1 ,not Active=0 

when i pass 2 display all record , 1 then active ,0 not active

if emp is active then value is 1 not active then value is 0 , when i choose all then display all record

Answers (1)
1
Tahir Ansari

Tahir Ansari

256 7.5k 224k 1y
SELECT *
FROM your_table_name
WHERE (Active = 1 AND 2 = ?) OR (Active = 1 AND 1 = ?) OR (Active = 0 AND 0 = ?);