[GNC] Help with SQL commands

Fred Tydeman tydeman.fred at gmail.com
Mon Dec 8 00:50:53 EST 2025


>
>
>   List of "stocks" in more than one Trading account:
>
>
Google Chrome AI came up with:

 SELECT
    c.mnemonic,
    COUNT(a.guid) AS trading_account_count
FROM
    accounts a
INNER JOIN
    commodities c ON a.commodity_guid = c.guid
WHERE
    a.account_type = 'TRADING'
GROUP BY
    c.mnemonic
HAVING
    COUNT(a.guid) > 1;

Again, it found several duplicates.  However, some of them are stocks
that have the same symbol as a currency.


More information about the gnucash-user mailing list