Hi ,

I have a table as follows:
Dealercode(varchar)     Fundname(varchar)       Trantype(varchar)
Month   Sales(bigdecimal)
Redemption(bigdecimal)  Nav(bigdecimal) Net_asset(bigdecimal)
Here the dealercode, fundname,trantype and month are concatenated keys.
Other fields depend on them jointly.

Now I want to get the following report based on a single query:


<dealer 1>
Fundname        Currentmonth_net_asset          Previousmonth_net_asset
x1              999.999                         9999.999
x2              9999.999                        999.99

Here the Currentmonth_net_asset means that Net_aset is summed up for:
1. a single dealer code;
2. various trantypes;
3. for current month
4. a single fund name. (This will form a single row)


Or the query has to be:
"find sum of Net_asset for Dealer 1 for the current and previous month and
show it, fund-wise".


Similarly, Previousmonth_net_asset does that for the previous month.

Can you kindly suggest a query to get it in a single query. I am using
My-SQL and there no way I can use a temp table or use stored proc.

Regards,
Partha
*********************************************************************
Disclaimer: The information in this e-mail and any attachments is
confidential / privileged. It is intended solely for the addressee or
addressees. If you are not the addressee indicated in this message, you may
not copy or deliver this message to anyone. In such case, you should destroy
this message and kindly notify the sender by reply email. Please advise
immediately if you or your employer does not consent to Internet email for
messages of this kind.
*********************************************************************

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to