Home » RDBMS Server » Performance Tuning » How the Query works
How the Query works [message #348973] Thu, 18 September 2008 07:51 Go to next message
Messages: 8
Registered: September 2008
Junior Member

Anyone explain how this query works...

select Report,BU,Sub_bu,file_order,total,
when sub_bu='ISS'
then max(case when sub_bu='ESS' then total end) over(partition by report)
when sub_bu='TS'
then max(case when sub_bu='Services' then total end) over(partition by report)
end as total_bu
from tsg

Re: How the Query works [message #348986 is a reply to message #348973] Thu, 18 September 2008 08:46 Go to previous message
Michel Cadot
Messages: 63923
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Have a look at SQL Reference:
CASE expression
(Sorry no link, online documentation currently not reachable from here).


Previous Topic: dbms_stats
Next Topic: SQL query performance issue
Goto Forum:

Current Time: Tue Oct 25 16:38:43 CDT 2016

Total time taken to generate the page: 0.06350 seconds