Strange error in mybatis mapper
===

I have a simple select I wrote in a myBatis mapper:

    <select id="listAllOrders" parameterType="java.util.HashMap" resultMap="commonMaps.detailedOrderResultMap">

		select

		<include refid="commonSql.fragmentOrderFields" />,
		<include refid="commonSql.fragmentSummaryPriceInfoFields" />
		
		from graorder order 
		      left outer join grasummarypriceinfo summarypriceinfo on order.totalPrice_id = summarypriceinfo.id

		<if test="userGroupId != null">
			where order.userGroupId = #{userGroupId}
		</if>

		order by order_lastUpdated desc

		<if test="limit != null">
			limit #{limit}
		</if>

	</select>

The complaining when running this query is:

   

     ### Error querying database.  Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntax
    ErrorException: You have an error in your SQL syntax; check the manual that corr
    esponds to your MySQL server version for the right syntax to use near 'left oute
    r join grasummarypriceinfo summarypriceinfo on order.totalPrice_id = su' at line
     33

I am simply discouraged. I can't see any error in my select...

Do you have any clue?

