Sunday 7 July 2019

sql logic in select statement, substitute value instead of value

select IIF (coalesce(IsRequiredDocReceived,0)=0 and coalesce(IsRefused,0)=0 and coalesce(IsApologized,0)=0 , 1,0) as isAllowEdit
FROM            ScholarshipSysApplicantApplications
where userid=1


coalesce: to substitute value instead of value if it is null
sql if value is null set value of another column