I have this SQL WHERE statement:
WHERE code = @code OR approvedby = @approvedby AND [status] = 'APPROVED'
I want to display the information of APPROVED status either code and approvedby parameter is true AND status must be APPROVED but the problem is PENDING status will also display.
Can anyone explain if I have made a mistake?