fix how not every SELECT has a FROM

found while doing some obscure migrations i think.