Avatar of praveen1981
praveen1981Flag for India asked on

required query

Hi

I have the table with following details.

 EMployee details
==================

s.no   empid  empname        comments             score

1           1            abc                     "hi man"              1

2           1             bbc                     "hi boy"              4

3            1             bbc                     "hi girl"              3

4             2             def                     "come here"     -2

5            2              ggf                     "go there"            4

6            2               dgf                       "go where"       -1


Here i have empid with  1 and 2  and go on... now for each and every employee

i want to get his last comment and Average of his score details and his least
score for which comment he got.


 for eg. i have to get as below for above table


s.no      empid            empname               comments             Averagescore     Least Score

3                 1                   bbc                          "hi girl"                       8/3= 2.666            1
 
6                  2                  dgf                            "go where"                +1/3= 0.333         -1

can you please guide me the query how to get it.
Microsoft SQL Server 2008

Avatar of undefined
Last Comment
PortletPaul

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
PortletPaul

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER
praveen1981

Many thanks..
PortletPaul

a pleasure.

May I ask why only "good"? Did I miss something?
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy