Quote:
not showing Pending where Get Null Value
If I understand you correctly, you want your WHERE clause to include cases where N.Flag is also NULL.
This is very easy, you just need to COALESCE it.
when COALESCE(N.Flag, '') = '' then 'Pending'
This means if N.Flag is either null or blank.