SQL 'Case'

How to write 'case' in Custom SQL, please let me know with example.

Here is the situation (SQL query) that I need to perform on Date table & likes to update 'IND' column where DateValue is default column in Date table

case when GETDATE()<=DateValue then 'N' else 'Y' end as 'IND' ,* from <table_name> order by DateValue desc

1 comment

Please sign in to leave a comment.