I want to have separate conditions according to a value of a column in the table. I'm trying like this but doesnt work.
SELECT p.flexible_lunch, b.contract
FROM SCH360_ACTIVITY_EMP_BASE p, SCH360_BREAKS_EMP b
WHERE p.resource_qry_seq = b.resource_qry_seq
AND p.resource_id = b.resource_id
AND CASE
WHEN b.flexible_time IS NULL THEN
((b.activity_start >= p.activity_start AND b.activity_end < p.activity_end) OR
(b.activity_start > p.activity_start AND b.activity_end <= p.activity_end))
ELSE
b.late_start >= p.late_start
END
Error says, 'missing right parenthesis'
Is this wrong? Cant we have conditions inside case like this? Please correct me.