Friday, 17 November 2017

Learn Sql server in hindi/urdu part-9 (Sum ,Top and Subquery on differen...





 select * from employee

  select * from department





  --display top 3 records from employee table.

  select top 2 * from employee  where emp_id < (select max(emp_id) from employee)  order by emp_salary desc





  select * from employee order by emp_salary asc





  --dispaly sum of salary of those employees who are working in Marketing department



  select sum(emp_salary) from employee e inner join department d on d.dept_id=e.dem_deptid

  where d.dept_name='Marketing'







  --display top 5 records of employees  who are working in Hr and Marketing

  select top 5 * from employee e inner join department d on d.dept_id=e.dem_deptid

  where d.dept_name='Marketing' or d.dept_name='Hr'


No comments:

Post a Comment

Pass Dynamically Added Html Table Records List To Controller In Asp.net MVC

Controller Code: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using ...