>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.