Advertisement

04.28.2008 at 02:31AM PDT, ID: 23358149
[x]
Attachment Details

SQL QUERY find field 1 with MAX value of field 2

Asked by logicalc in Databases Miscellaneous, FoxPro Database

Tags: Visual FoxPro 6

My table contains records for timesheets. Each timesheet is analysed by consultant and can have several records, indicating the percentage allocated to each consultant (field "cons"). Table is in FoxPro 2.6 format.

For each timesheet (field is "tsno") I want to find the value of field "cons", for which the "perc" value is highest.

Example source table:
tsno perc cons
1 95 A
1 5 B
2 100 C
3 50 B
3 50 D

Desired output:
tsno cons
1 A
2 C
3 could be B or D - I am not bothered which where they are equal

How can I achieve this please?Start Free Trial
[+][-]04.28.2008 at 03:46AM PDT, ID: 21452780

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.28.2008 at 04:58AM PDT, ID: 21453097

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.28.2008 at 05:02AM PDT, ID: 21453116

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.28.2008 at 05:58AM PDT, ID: 21453464

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.28.2008 at 07:26AM PDT, ID: 21454281

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Databases Miscellaneous, FoxPro Database
Tags: Visual FoxPro 6
Sign Up Now!
Solution Provided By: tusharkanvinde
Participating Experts: 2
Solution Grade: A
 
 
[+][-]04.28.2008 at 09:54AM PDT, ID: 21455572

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 - Hierarchy / EE_QW_2_20070628