Return typed result from select query.