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
ASKER CERTIFIED SOLUTION
Avatar of PortletPaul
PortletPaul
Flag of Australia image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of praveen1981
praveen1981
Flag of India image

ASKER

Many thanks..
Avatar of PortletPaul
PortletPaul
Flag of Australia image

a pleasure.

May I ask why only "good"? Did I miss something?
Microsoft SQL Server 2008
Microsoft SQL Server 2008

Microsoft SQL Server 2008 is a suite of relational database management system (RDBMS) products providing multi-user database access functionality.Component services include integration (SSIS), reporting (SSRS), analysis (SSAS), data quality, master data, T-SQL and performance tuning. Major improvements include the Always On technologies and support for unstructured data types.

50K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo