How the Query works [message #348973] |
Thu, 18 September 2008 07:51 |
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 |
|
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
|
|
|