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: 64131
Registered: March 2007
Location: Nanterre, France, http://...
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: Wed Dec 07 14:26:40 CST 2016

Total time taken to generate the page: 0.08885 seconds