How the Query works [message #348973] |
Thu, 18 September 2008 07:51 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
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 Go to previous message](/forum/theme/orafaq/images/up.png) |
![](http://www.orafaq.com/forum/images/custom_avatars/102589.gif) |
Michel Cadot
Messages: 68678 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
|
|
|