abed ahmad

abed ahmad

  • 1.6k
  • 65
  • 814

sql server2008 select statement

Aug 8 2015 2:59 AM
how to find max salary and min salary,employee name,and department name 
suppose we have the following database table
 
 
emp_noemp namebranch namesubject                 mark
4101      jhon           a1                   mathmatex         82.97
4122petera1mathmatex
83.09
4123nelsona1physics89.09
4129suzanb1mathmatex90.00
4125fredreka1physics99.00
 
 
i need the result as
  
 

emp_no

emp name

branch name

subject

max

emp_no

emp name

branch name

subject

min

4129

suzan

b1

mathmatex

90

4101

jhon

a1

mathmatex

82.97

4125

fredrek

a1

physics

99

4123

nelson

a1

physics

89.09

 
 
 
 
 
 

Answers (6)