Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Group by clause is missing or invalid
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01120983
Message ID:
01121317
Views:
8
>>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform