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
basmraj
Messages: 8
Registered: September 2008
Junior Member
Hi,

Anyone explain how this query works...

select Report,BU,Sub_bu,file_order,total,
case
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


thanks
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: 68716
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Have a look at SQL Reference:
CASE expression
MAX
(Sorry no link, online documentation currently not reachable from here).

Regards
Michel



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


Current Time: Tue Nov 26 09:44:45 CST 2024