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+unsubscr...@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

Reply via email to