Mysql
 sql >> Database >  >> RDS >> Mysql

Errore SQL:'database.table.field non è in GROUP BY

Stai selezionando b.blog_id e raggruppamento per e.blog_id . Questo è il problema.

SELECT MAX(e.entry_id) as max, MAX(e.entry_date) as maxdate,b.blog_id, b.blog_name, b.blog_seo_name 
FROM blog_entries e  LEFT JOIN 
     blog_blogs b ON ( b.blog_id=e.blog_id )   
WHERE e.entry_status='published' AND e.entry_banish=0 AND e.entry_featured=0 
     AND b.blog_view_level='public' AND b.blog_disabled=0 
GROUP BY b.blog_id, b.blog_name, b.blog_seo_name 
ORDER BY maxdate DESC LIMIT 0,50