sql: nelements diverts to count