Monday, April 25, 2022

SQL Case when with where clause when then condition

 SELECT * FROM VW_MST_BATCH where [RequestStatus]=2 and Batch_Status=1

and Agency_id=1 and State_id=


case

when 0 = 0

then State_id

else 5

end

and Training_Partner_id='ESDM-JK-TP-000045'

------------

case

when 0 = 0

then State_id

else ''

end

and Training_Partner_id='ESDM-JK-TP-000045'

No comments:

Post a Comment