Date: prev next · Thread: first prev next last
2022 Archives by date, by thread · List index


Yes that works, too. I notice that Base strips off the 'AS' keywords.

Cheers
Harvey


On Tue, 2022-08-16 at 16:02 +0200, Robert Großkopf wrote:
Hi Harvey,

tested this:

SELECT COALESCE ( `User`, 'Empty' ) AS `User`, COUNT( `ID` ) FROM 
`test`.`User` AS `User` GROUP BY `User`

You don't need to change the alias for `Location` to `Loc`.
I could save this, open this to edit in GUI, execute it - no Problem 
with direct connection on MariaDB.

When trying the same with MariaDB and JDBC I will get:
Column 'User' in group statement is ambiguous at 
/home/buildslave/source/libo-
core/connectivity/source/drivers/jdbc/SQLException.cxx:35

Changing the code to
SELECT COALESCE ( `User`, 'Empty' ) AS `Us`, COUNT( `ID` ) FROM 
`test`.`User` AS `User` GROUP BY `User`
and the query will work. Won't be detroyed also through GUI.

GUI will destroy the query when setting
GROUP BY `Us` instead of GROUP BY `User`. Seems it hat problems using
the alias for a group. But the alias isn't needed there, so set 
`Location` instead of `Loc`

Regards

Robert
-- 
Homepage: https://www.familiegrosskopf.de/robert



-- 
To unsubscribe e-mail to: users+unsubscribe@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.