Tag: Query

Alias Names for Tables in SQL Query

There are times when you write query and end up qualifying the columns references by indicating the table name. For example , In the above query , the Department table is referred in the GroupName and Name column. Instead of mentioning the table table , we could provide a shortname or alias name for the table and use the alias name instead. The full use…

How to get specific columns from a Table in SQL Query ?

If you want to get the data from the specific columns from a table in your database , you can specify them in the query. For example, This would return the data of all the columns available in the Department table. If you want to get the data of the specific columns from the Department table , you can specify the column names in the…

Using NOT operator to inverse the condition in SQL Server

Imagine a scenario where you want to retreive records that you dont want. You can use the NOT operator to reverse the search condition. For example , You want to get all the departments having the GroupName other than ‘Research and Development’. The other way of getting the same result is using the != in every condition.