Advertisement

06.01.2007 at 08:20PM PDT, ID: 22608623
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

Combine Aggregate and Non-Aggregate Fields in a single statement

Tags: aggregate, combine, fields
Thank you for reading my question.

Let's say that I have a list of products in a table entitled tblProductHistory with the following fields:

intProductHistoryID   integer autoincrement
intTechnician             integer (foreign key to tblTechnicians)
intProductID              integer (foreign key to tblProducts)
datRepairFinished     datetime


To find the most recent repair date for any given item, I can do:

SELECT intProductID,
             MAX(datRepairFinished) AS datLatestRepair
FROM tblProductHistory
GROUP BY intProductID
ORDER BY intProductID;

and that will give me the product id and the latest date it was repaired.

Now, if I wanted to add the technician ID, I would be unable to do so as it is not part of an aggregate function or the GROUP BY clause.

I suspect that the way to approach this is to join two select statements: the one above, and another that includes the intTechnicianID. However, I am not sure how to do this.

Would anyone point me in the right direction?

Thank you,

FtB
Start your free trial to view this solution
Question Stats
Zone: Microsoft
Question Asked By: fritz_the_blank
Solution Provided By: LPurvis
Participating Experts: 3
Solution Grade: A
Views: 4
Translate:
Loading Advertisement...
06.01.2007 at 09:44PM PDT, ID: 19199832

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
06.01.2007 at 09:46PM PDT, ID: 19199835

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
06.02.2007 at 02:11AM PDT, ID: 19200233

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
06.02.2007 at 07:52AM PDT, ID: 19200742

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
06.02.2007 at 11:07AM PDT, ID: 19201270

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
06.02.2007 at 11:40AM PDT, ID: 19201317

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
06.02.2007 at 11:41AM PDT, ID: 19201319

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
06.03.2007 at 06:44AM PDT, ID: 19203655

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
06.03.2007 at 06:59AM PDT, ID: 19203691

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
06.03.2007 at 09:05AM PDT, ID: 19204147

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
06.03.2007 at 09:30AM PDT, ID: 19204211

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
06.03.2007 at 02:14PM PDT, ID: 19204913

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
06.03.2007 at 03:02PM PDT, ID: 19205055

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
20080236-EE-VQP-29