Categories
Sql Server

How to use where clause in Sql server

The WHERE clause is used to find only  records that fulfill a specified criteria. Where Syntax:- Select * from table name where city=’city name’ Example Table:- ID Name Class Roll No 1 Jai B.A 12 2 Mohan M.A 23 4 Om B.A 2 Select * from example where class=’B.A’ Result:- ID Name Class Roll No 1 […]

Categories
Sql Server

How to select Distinct records from a table in Sql server

In tables some of the columns may contain duplicate values. But you want to list out the (distinct) values of a coloum in that table. The DISTINCT keyword can be used to return only distinct (different) values. First of all create a table. create table dept_test( Deptno int,dname varchar(20),loc varchar(20)) Then insert records into the table you […]

Categories
Sql Server

Query to get total salary of a Department

Query to get total salary of a Department In organizations their are several departments.To calculate the total salary of that department in SQL server is so easy. Query: select deptno ,sum(basic) as total from emp group by deptno Here Deptno refers to Dept which salary you want calculate and basic refers to the Salary column […]

Categories
Sql Server

How To run a Stored Procedure Through Microsoft Excel

In this article i will show you you how to get data from sql server in excel by run stored procedure in Microsoft Excel. 1. Open Microsoft Excel. 2. Go to Data tab. 3. Then Go to Other data source menu in it. 4.       5.  Fill your details in pop-up box as shown in […]