Friday, 19 January 2018

How to Select a specific record from Employee Table without using Where Clause in SQL Server

SQL Server Query to Filter a specific record from an Employee Table without using Where Clause
Scenario:
Suppose we have an Employee Table as follows..
Select Emp_Id, NetSal From Tbl_Emp
From the above Table Tbl_Emp if we want to filter or select the details of an employee whose Emp_Id=126, we can do it using the below Query :

Select Emp_Id,Sum(NetSal) Net_Sal From Tbl_Emp 
Group By Emp_Id
Having Emp_Id=126

GO

Result :
Emp_Id Net_Sal
  126       8893

Thanks, Tamatam

No comments:

Post a Comment

Hi User, Thank You for visiting My Blog. Please post your open Feedback only related to this Blog Posts. Please note that I cannot respond to the Anonymous Comments.

Subscribe to Blog Posts by Email

ExcelKingdom-Popular Posts