LibreOffice Base MySQL query gives error 1064 in phpMyAdmin

Jordon Bedwell jordon at envygeeks.com
Fri May 20 19:47:55 UTC 2011


On 5/20/2011 2:27 PM, Amedee Van Gasse wrote:
> SELECT YEAR( 'logfiledate' ), MONTH( 'logfiledate' ), 
> 'Sessions'.'UserId', 'Users'.'Name', 'Users'.'FirstName', 'Users'.'Cat', 
> SUM( 'Sessions'.'TotalTime' ) FROM 'loganalyser'.'Sessions' AS 
> 'Sessions', 'loganalyser'.'Users' AS 'Users', 'loganalyser'.'Logfiles' 
> AS 'Logfiles' WHERE 'Sessions'.'UserId' = 'Users'.'Trigram' AND 
> 'Sessions'.'LogFile' = 'Logfiles'.'logfile' AND YEAR( 'logfiledate' ) = 
> '2011' AND MONTH( 'logfiledate' ) = '12' GROUP BY 'Sessions'.'UserId' 
> ORDER BY SUM( 'Sessions'.'TotalTime' ) DESC

Your critical error is 'Sessions'.'UserId' it should be sessions.userid
without any wrap, without wrapping table and row and the concatenating,
it should simply be table.row without anything else.

I'm a bit confused about what you're doing anyways, this query seems
like it would be much better suited as a JOIN instead of an unoptimised
long query :P.




More information about the ubuntu-users mailing list