select query parsing