Microsoft
Software
Hardware
Network
Question : grouping by one column, and wanting another column in result
select CategoryPK, max (ValidAmtFK) as MaxValidAmt from
TABLES WHERE CONDITIONS
Group by CategoryPK
CategoryPK is more reliable than CategoryDesc
After finding max (ValidAmtFK), the only real end result I want is ValidAmt value.
So I need CategoryDesc, ValidAmt as the resultset.
But I need to group by CategoryPK and do max (ValidAmtFK) and not max (ValidAmt)
Is the only option to bring this is to have another level of Joins outside the above query, and making the above query as a derived table?
this is in SQL 2000.
Answer : grouping by one column, and wanting another column in result
please see my article on how to implement this kind of query:
http://www.experts-e
xchange.co
m/articles
/Database/
Miscellane
ous/DISTIN
CT-vs-GROU
P-BY-and-w
hy-does-it
-not-work-
for-my-que
ry.html
Random Solutions
drop all indexes
win 7 - user profile cannot be loaded.
Migration from win 2008 sbs to one win 2008 dc\file server and one win 2008 exchange server.
How to export from MS access form to MS word
how can i change the option button value from vb.net to a word 2007 document?
Excel Emailing Worksheet
Hard drive showing significantly less space available then WinDirStat shows?
What is wrong with the scaler function
How to write an Web Service API ?
SSRS 2005 How to set the Visibility on Matrix Data Column