wats the benefit of using the both?

<select id="selectItemCount" resultClass="int">

SELECT COUNT(*) AS total

FROM items

WHERE parentid = 6

</select>

<select id="selectItems" resultClass="Item">

SELECT id, name

FROM items

WHERE parentid = 6

</select>

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------

To eliminate this duplication, we use the tags <sql> and <include>. The <sql>-tag contains the fragment to reuse, the <include>-tag to include such a fragment:

<sql id="selectItem_fragment">

FROM items

WHERE parentid = 6

</sql>

<select id="selectItemCount" resultClass="int">

SELECT COUNT(*) AS total

<include refid="selectItem_fragment"/>

</select>

<select id="selectItems" resultClass="Item">

SELECT id, name

<include refid="selectItem_fragment"/>

</select>

 P R A D H E E P A P P L I E D    D E V E L O P M E N T 
Team Leader
Chennai, India
e: [EMAIL PROTECTED]
 l: 00 91 44 39125333
m: 00 91 94862 08089

Reply via email to