CTE aggregate

2 views
Skip to first unread message

Pramod Jamadagni

unread,
Aug 19, 2011, 11:17:42 AM8/19/11
to Pramod Jamadagni, dwhte...@googlegroups.com

with UdateProd(P1,P2,C) as

(

select product_id,Parent_Product_Id,isnull(Is_Client_prod,0) C from prod

Union All

select P1,Parent_Product_Id,C from UdateProd join prod on p2 = product_id

) select P2,Max(C) C into #t from UdateProd where p2 is not null group by P2 order by 1,2

"This email and any files transmitted with it contain confidential, proprietary,
privileged information of Symphony Services Corp (India) Pvt. Ltd. and are intended
solely for the use of the recipient/s to whom it is addressed. Any unauthorized
notifying, copying or distributing of this e-mail, directly or indirectly, and the
contents therein in full or part is prohibited by any entity who is not a recipient.
Any email received inadvertently or by mistake should be deleted by the entity who
is not a recipient thereof. You may be pleased to notify the sender immediately by
email and the email should be deleted from your system".
Reply all
Reply to author
Forward
0 new messages