> First works, second form does not.
Could you be more specific, what "not works" exactly means?
Does it return wrong result?
Does it raise an exception (which one)?
Does it restart the server?
Does it ...?
I just wonder what SUM(*) means and I doubt whether it does not fail too; but maybe it is OK with one column sub-query.
According to SUM(mynum): as you named the nested query column "mynum" (with double quotes), its name is not mynum. So you shall reference it with double quotes as "mynum" (or remove double quotes from the column alias).