Subject | Re: [firebird-support] Getting Group By subtracting total for every record in the group |
---|---|
Author | Vishal Tiwari |
Post date | 2018-06-05T07:03:44Z |
Hi SET,
Would you please help me in this SQL ?
With Best Regards.
Vishal
On Monday, 4 June, 2018, 11:52:36 AM IST, Vishal Tiwari vishualsoft@... [firebird-support] <firebird-support@yahoogroups.com> wrote:
Hi Dimitry,
I also need to display In_Val and Out_Val column in the result. So even after trying as you suggested, can't able to get the result as shown below:
Card_No | Card_Cat | In_Val | Out_Val | Total_Remain |
1 | 11 | 100 | 0 | 100 |
1 | 11 | 0 | 20 | 80 |
1 | 11 | 25 | 0 | 105 |
1 | 12 | 50 | 0 | 50 |
1 | 12 | 0 | 30 | 20 |
2 | 15 | 60 | 0 | 60 |
2 | 15 | 0 | 35 | 25 |
With Best Regards.
Vishal
On Monday, 21 May, 2018, 11:36:38 AM IST, Vishal Tiwari vishualsoft@... [firebird-support] <firebird-support@yahoogroups.com> wrote:
Hi Dimitry,
Thank You for the reply.
Let me check and revert.
With Best Regards.
Vishal
On Saturday, 19 May, 2018, 8:50:58 PM IST, Dimitry Sibiryakov sd@... [firebird-support] <firebird-support@yahoogroups.com> wrote:
19.05.2018 17:12, Vishal Tiwari vishualsoft@... [firebird-support] wrote:
> I have below table requirement, where the data should be subtracted for each record in the
> row. For each group subtraction should be separate.
It looks like you need something like "SUM(In_Val-Out_Val) OVER (GROUP BY Card_No,
Card_Cat)"
--
WBR, SD.
------------------------------------
------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu. Try FAQ and other links from the left-side menu there.
Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
------------------------------------
Yahoo Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/firebird-support/join
(Yahoo! ID required)
<*> To change settings via email:
firebird-support-digest@yahoogroups.com
firebird-support-fullfeatured@yahoogroups.com
<*> To unsubscribe from this group, send an email to:
firebird-support-unsubscribe@yahoogroups.com
<*> Your use of Yahoo Groups is subject to:
https://info.yahoo.com/legal/us/yahoo/utos/terms/
> I have below table requirement, where the data should be subtracted for each record in the
> row. For each group subtraction should be separate.
It looks like you need something like "SUM(In_Val-Out_Val) OVER (GROUP BY Card_No,
Card_Cat)"
--
WBR, SD.
------------------------------------
------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu. Try FAQ and other links from the left-side menu there.
Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
------------------------------------
Yahoo Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/firebird-support/join
(Yahoo! ID required)
<*> To change settings via email:
firebird-support-digest@yahoogroups.com
firebird-support-fullfeatured@yahoogroups.com
<*> To unsubscribe from this group, send an email to:
firebird-support-unsubscribe@yahoogroups.com
<*> Your use of Yahoo Groups is subject to:
https://info.yahoo.com/legal/us/yahoo/utos/terms/