Tag: Statement

How to Update From Select Statement in SQL Server ?

Below is a sample query that demonstrates how to update a table by getting the data from the select query in SQL Server. Assume that there are 2 tables AbundantCodeEmployee and AbundantCodeDepartment which contains the id . The id(in department) in this example refers to the department head . The columns “DepartmentName” is updated in the query based on the value retreived  . How to Update From…

Equivalent of IF Statement in SQL Server

There are times when you want to perform conditional checks within a SQL Query in SQL Server . Below is a sample Query that demonstrates how to do it. Equivalent of IF Statement in SQL Server Assume that the Employee table contains a column called “Designation” and we might want to show a value 1 if the designation is SSE else show 0 . You…