troubleshooting Question

required query

Avatar of praveen1981
praveen1981Flag for India asked on
Microsoft SQL Server 2008
3 Comments1 Solution205 ViewsLast Modified:

I have the table with following details.

 EMployee details
==================   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      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.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 3 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros