473,387 Members | 1,572 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Use of OLAP function

Hi Friends,
can anybody help me in rewriting below query with the help of OLAP
functions. I never used OLAP functions , so need help in this regard.

SELECT C.UNIT, C.DT from tab1 C where C.DT = (SELECT MAX(C_ED.DT) FROM
tab1 C_ED WHERE C.UNIT = C_ED.UNIT AND C.ID = C_ED.ID AND C_ED.DT <=
CURRENT DATE)

Thanks in advance
Sandy
Nov 20 '08 #1
1 3149
On Nov 20, 12:02*pm, "sandeep.i...@gmail.com" <sandeep.i...@gmail.com>
wrote:
Hi Friends,
can anybody help me in rewriting below query with the help of OLAP
functions. I never used OLAP functions , so need help in this regard.

SELECT C.UNIT, C.DT from tab1 C where C.DT = (SELECT MAX(C_ED.DT) FROM
tab1 C_ED WHERE C.UNIT = C_ED.UNIT AND C.ID = C_ED.ID AND C_ED.DT <=
CURRENT DATE)
select unit, dt from (select unit, dt, max(dt) over(partition by unit,
id) as max_dt where dt <= current date) sub
where dt = max_dt

Note that some description behind what this query is supposed to do
would help in figuring out the right answer - this is just a guess
that should replicate what your query is returning.

Chris
Nov 21 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Will | last post by:
On the subject of Data Warehouses, Data Cubes & OLAP…. I would like to speak frankly about Data Warehouses, Data Cubes and OLAP (on-line analytical processing). Has it dawned on anyone else...
0
by: DD | last post by:
Hi Guys! Just would like to share with you my experiense in this matter. I was trying to evaluate how suitable Oracle OLAP for our applications. As probably you did, I have downloaded from OTN...
7
by: Will | last post by:
On the subject of Data Warehouses, Data Cubes & OLAP…. I would like to speak frankly about Data Warehouses, Data Cubes and OLAP (on-line analytical processing). Has it dawned on anyone else...
2
by: Gadi Refaeli | last post by:
Hello All, We are currently considering DB purchases for a new system, we are looking at Cognos, Oracle, DB2 and Essbase. We came across some questions regarding Essbase and DB2 OLAP. 1. Are...
4
by: TP | last post by:
Please let me know. thanks. TP
3
by: Eduardo Quiroz Salinas | last post by:
do someone knows where can i get a good tutorial or how to make OLAP cubes.???? thanx a lot -- Linux user number 344659 "...Los que no requieren de un dios para ser virtuosos, son la...
3
by: Joel Leong | last post by:
I use C# to invoke DTS. The DTS run successfully if no process cube function in it. But after i add process cube function, the ASP.NET page hang. I even impersonate ASP.NET to an account with...
0
by: YellowFin Announcements | last post by:
Yellowfin Reporting Announces Release 3 OLAP Connectivity New Features Including OLAP-to-Relational Drill Through Provide Customers with One Complete Web BI Tool for OLAP Analysis Yellowfin,...
0
by: YellowFin | last post by:
Yellowfin Announces Release 3 OLAP Connectivity New Features Including OLAP-to-Relational Drill Through Provide Customers with One Complete Web BI Tool for OLAP Analysis Yellowfin, today...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.