Category: SQL

SQL 0

How do I escape a single quote in SQL Server

A single quote can be escaped by doubling them up in MSSQL server. There are many ways to escape a single quote in SQL server. Let us look at the below examples to find...

SQL 0

How to Delete Duplicate Rows in sql

There are many ways to identify and delete duplicate rows in SQL. The best way to achieve this would be by using the ROW_NUMBER over Partition by column list. This will partition the table...

SQL 0

How to find nth highest salary using SQL query

This is a common SQL question which will be asked in most of the interviews and also if you are working related to the financial application then most of them would have come across...

SQL 0

How to Format Query Results as JSON in MSSQL

One of the top features of MSSQL server 2016 is built in support of JSON. Yes, now we can format query results as JSON in MSSQL 2016 version onwards. The data from the MSSQL...

SQL 0

How to add root node to JSON output in MSSQL?

MSSQL 2016 has a new feature where you can return the data as JSON output format and also add root node to JSON output in MSSQL. Checkout MSSQL Built-In JSON support for more details....

SQL 0

How to find size of table in MSSQL?

Everyone would have come across a scenario where there is a need to find the Size of the table in MSSQL. There are multiple ways to find size of table in MSSQL. How to...