Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem Query
Message
De
19/07/2000 10:36:08
 
 
Information générale
Forum:
Oracle
Catégorie:
PL/SQL
Titre:
Divers
Thread ID:
00393781
Message ID:
00394328
Vues:
10
Hi Mark,

>In Oracle, you have to GROUP BY every column that is not selected as an aggregate. In your example above you have to GROUP BY all 5 of the first columns.
>
>Did you see my reply to this in the VFP forum?

Yes, but I've received conflicting replies from the VFP forum and this forum.

When I execute:

Select course,subject,held,course_date,idtraining from training group by course,subject,held,course_date,idtraining;

all of the records are returned from Oracle, VFP or SQL Server.

I'm confused, because in my opinion this makes GROUP BY redundant in Oracle, as you are saying that all of the fields MUST be included in the GROUP BY clause.

To illustrate my problem, my sample data is as follows:
Course  Subject  Held       Course_Date  IdTraining
Matt1   Test1    01/02/2000 01/02/2000   2
Matt2   Test2    15/02/2000 17/02/2000   3
Matt1   Test1    01/02/2000 01/02/2000   4 
There are other fields in the table, but these are the ones I will be displaying to the user.

When I execute my query, I want to return the following:
Course  Subject  Held       Course_Date  IdTraining
Matt1   Test1    01/02/2000 01/02/2000   4 
Matt2   Test2    15/02/2000 17/02/2000   3
I can do this easily in SQL Server or VFP, simply by grouping on Course.

Are we really saying that it is impossible to get this result from an Oracle back-end ?

Best.

Matt.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform