//
archives

MS SQL

This category contains 0 posts

Clustered Index and Non-Clustered Index

As developers, we often use the clustering index and non-clustered index, if I ask most people the following two questions may have few satisfactory answers. What is the clustering index (clustered index) / What is non-clustering index (nonclustered index)? clustered index and non-clustered index What is the difference? In fact, the index can be understood … Continue reading

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

Four advanced features SQL Server index

Index Building Filter (filter when the index is created) There are some very inefficient index, such as regular query the status of ongoing orders, order 99% of the state is complete, one percent is in progress, so we built an index on the order status field, performance is improved, but the feeling in the index … 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.