SQL Server Query

This category contains 2 posts

T-SQL (1)

Using Variables Like C language, variables are divided into: Local variables: Local variables must be marked with @ as a prefix, such asage Use of local variables is the first statement, and then the assignment Global variables: Global variables must mark @@ as a prefix, such as @@version Global variables, we can only be read … Continue reading

SQL Server Co-related Query – Select the second highest

This a good example of the co-related query. For example we have table with 5 employees and their salary. If we want to query the employee with second highest salary, we can use the query below.