Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Query Problem
Message
From
18/07/2000 10:22:41
Mark Hall
Independent Developer & Voip Specialist
Keston, Kent, United Kingdom
 
 
To
18/07/2000 10:11:53
General information
Forum:
Visual FoxPro
Category:
Client/server
Title:
Miscellaneous
Thread ID:
00393731
Message ID:
00393787
Views:
15
>Hi Mark,
>>
>>Do you really want a GROUP BY here? You don't have any aggregate fields (SUM(), MAX(), etc)
>>
>>For 'standard' SQL you have to include all non-aggregate SELECTed fields in the GROUP BY Clause,
>>
>
>Well, it works ok [and gives me the result I want] in both SQL Server and VFP now if I use:
>
>Select training.idtraining, training.course, training.subject, training.held from training group by training.course
>
>However, this doesn't work in Oracle.
>
>>Maybe you just need a SELECT Distinct?
>>
>>i.e.
>>Select DISTINCT training.idtraining, training.course, training.subject, training.held from training
>
>No. Because idtraining is unique for every record in the training table, your query results in all records being returned. I want one record for each unique value of training.course. ;-(
>
>I'm going to post a message in the Oracle forum to see if anyone there has any ideas.
>
>Best.
>
>Matt.

So, idtraining must be redundant in your result set as it can't have a meaningful value after this query - an arbitrary idtraining will be presented for each course.

If you leave idTraining out of the query, the select distinct should work?

If this still isn't right, you'll have to post a bit of data to help clarify things.
Regards
Mark

Microsoft VFP MCP
Menulib - OO Menus for VFP www.hidb.com/menulib
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform