wrap query in single quotes rather than double. the double quotes weren't doing it as "select * ..." was shell expanding the *