Re: Perfectly valid MySQL query gives syntax error in LibreOffice Base (was: the other way around)



On Fri, 2011-05-20 at 23:52 +0200, Amedee Van Gasse wrote:
On 05/20/11 23:44, Amedee Van Gasse wrote:

Same query, rewritten from scratch:

SELECT YEAR(logfiledate) AS Year, MONTH(logfiledate) AS Month, UserId,
Name, FirstName, Cat, SUM(TotalTime) AS TotalTime
FROM Sessions
LEFT JOIN Logfiles on Sessions.LogFile = Logfiles.logfile
LEFT JOIN Users on UserId = Trigram
WHERE YEAR(logfiledate) = 2010
AND MONTH(Logfiles.logfiledate) = 12
GROUP BY UserId
ORDER BY TotalTime DESC, UserId ASC
LIMIT 0, 10

Much cleaner, methinks.
Thanks to all who contributed, or for just being my wall.
Case closed.

Case not entirely closed.
Now I have a perfectly valid MySQL query, verified with phpMyAdmin, and
LibreOffice Base claims that I have syntax terror in SQL expression.

I think I'll have to file that bug report after all...

I might be wrong, but when using Base for MySQL connectivity you have to
use the ` quotes. If using the HSQL, you use the " quotes. It has been
awhile since I used Base but I seem to remember that frustrating me a
lot when trying to use it for quick development of SQL code and then
copy pasting that into phpMyAdmin.


--
ubuntu-users mailing list
ubuntu-users@xxxxxxxxxxxxxxxx
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users



Relevant Pages