Home » SQL & PL/SQL » SQL & PL/SQL » Using Window Function in a query Block - Count and Sum (Database - 12c)
Using Window Function in a query Block - Count and Sum [message #674848] Tue, 19 February 2019 08:00 Go to next message
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 Go to previous messageGo to next message
Michel Cadot
Messages: 66930
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.

Re: Using Window Function in a query Block - Count and Sum [message #674856 is a reply to message #674848] Tue, 19 February 2019 11:42 Go to previous message
EdStevens
Messages: 1188
Registered: September 2013
Senior Member
Also asked over on the OTN forums:
https://community.oracle.com/thread/4202098
Previous Topic: Executing dynamic sql using forall
Next Topic: Scrambling the data for dev environment after refresh to hide/mask the sensitive data
Goto Forum:
  


Current Time: Wed Apr 01 04:31:22 CDT 2020