sql: resolve ambiguity around nelements, Select