Hi there,

problem: I wish to get the production of a client through different period
of times.

the simple most sql will be:

*********** SQL ******************
SELECT client_ID, SUM(production) , #date1# AS start_date, #date2# AS
end_date
FROM client_production
WHERE client_ID=33293
AND production_date between #date1# and #date2#
GROUP BY client_ID

But! the date changes from period to period (eg., quarter basis through the
past 3 years).
For this, I assume I should use a UNION and change the date1/2 (if you have
better SQL solution please let me know)

* can anyone advise how to do that with <iterator>?

Thank you!
-- 
View this message in context: 
http://www.nabble.com/howto-do-iteration-with-UNION-tp20820524p20820524.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.

Reply via email to