Setting explicitly from query

You can also set the value for a group of variables using the non-scalar form of the set tag, shown below, which will set the value of ${myquery.col1} to the value returned from the SELECT statement.

<set name="${myquery}">
  <sql><stmt>select col1 from mytable where col2=45</stmt></sql>
    <resultset id="1">
      <row id="1">
        <col id="1" name="c1" type="INTEGER">${col1}</col>