Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
asifbhura
Posting Yak Master
165 Posts |
Posted - 2013-09-06 : 16:30:39
|
Hello...
I have records as below
std_name std_id Grade ABC 456 7 - A ABC 456 8 - B XYZ 568 2 - C XYZ 568 5 - D
I want to distinct with std_code and max with grade like below
std_name std_id Grade ABC 456 8 - B XYZ 568 5 - D
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2013-09-06 : 17:21:34
|
select std_name, std_id, max(Grade) Grade from <yourTable> group by std_name, std_id
Be One with the Optimizer TG |
 |
|
VeeranjaneyuluAnnapureddy
Posting Yak Master
169 Posts |
Posted - 2013-09-10 : 05:06:50
|
quote: Originally posted by TG
select std_name, std_id, max(Grade) Grade from <yourTable> group by std_name, std_id
Be One with the Optimizer TG
veeranjaneyulu |
 |
|
|
|
|