Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Group by clause is missing or invalid
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01120983
Message ID:
01121317
Vues:
17
>>Yes, you may try to re-write your select this way:
>>
>>select * from Table1 inner join Table2 on Table1.Pk = Table2.fk ;
>>inner join (select Pk, Min(date) as MinDate from Table2 group by 1) ;
>>MinDate on Table2.Pk = MinDate.Pk
>
>Thanks, with your help I came up with the following solution which works for me:
>
>SELECT 	 title, body,abstract,blog_config.author,tblMaxEntries.*,;
>		 ALLTRIM(SUBSTR(basepath,AT("/",basepath)+1)) as gebruiker;
>from blog_entries;
>inner join;
>(select blogpk,Max(entered) as entered FROM blog_entries GROUP BY blogpk) tblMaxEntries;
>ON tblMaxentries.blogPK = blog_entries.blogpk AND blog_entries.entered = tblMaxentries.Entered;
>right OUTER JOIN blog_config;
>on blog_config.pk = blog_entries.blogpk
>
Hi,

As Fabio pointed out, if BlogPk is a unique identifier in the blog_entries table, then this select doesn't make any sense
select blogpk,Max(entered) as entered FROM blog_entries GROUP BY blogpk

Sorry if I stir you into wrong direction.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform