Using Window Function in a query Block - Count and Sum [message #674848] |
Tue, 19 February 2019 08:00 |
|
indianscout
Messages: 1 Registered: February 2019
|
Junior Member |
|
|
Hi,
How can I use a window function for the below Query Block ?
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
select bm.book_cd_id, count(*), sum(amt)
from ldfods_prd.gl_fincl_dtl fd,
ldfods_prd.gl_book_cd_hier_mstr bm
where fd.book_cd_mstr_id = bm.book_cd_mstr_id
and fy = 2017
and acctg_prd = 1
group by bm.book_cd_id;
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Thanks
TG
|
|
|
Re: Using Window Function in a query Block - Count and Sum [message #674851 is a reply to message #674848] |
Tue, 19 February 2019 08:17 |
|
Michel Cadot
Messages: 68653 Registered: March 2007 Location: Nanterre, France, http://...
|
Senior Member Account Moderator |
|
|
Welcome to the forum.
Please read OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code, use code tags and align the columns in result.
If you don't know how to format the code, learn it using SQL Formatter.
Use the "Preview Message" or "Preview Quick Reply" button to verify.
Also always post your Oracle version, with 4 decimals, as solution depends on it.
With any SQL or PL/SQL question, please, Post a working Test case: create table (including all constraints) and insert statements (without any schema or storage parameters) along with the result you want with these data then we will be able work with your table and data. Explain with words and sentences the rules that lead to this result.
Your question is not clear, the test case will make it clear.
|
|
|
|