August 20, 2005 at 12:30 am
select folio_no,product_cd,min(rm_cd) as rm_cd,min(branch_cd) as branch_cd
from #tmp1 group by folio_no,product_cd
having count(distinct rm_cd) = 1
i have being told to debug the stored procedure, write down what this stored procedure does ?..
but iam unable to tell
can u tell me the above query which i have posted. contains min(rm_cd),min(branch_cd)
i dont know why have they used for..
rm_cd & branch_cd are primary keys in there respective tables
rm_cd is in regional manager master
& branch_cd in branch_master
and mftrans is a transactional table, which stores there codes
thank u, if it makes sense to u, pls post
<a href="http://www.websolsoftware.com"> For IT jobs click here</a>
*Sukhoi*[font="Arial Narrow"][/font]
August 23, 2005 at 8:00 am
This was removed by the editor as SPAM
August 23, 2005 at 8:10 am
This query selects those groups (folio_no, product_cd) that have ONLY 1 value for rm_cd in GROUP
count(distinct rm_cd). min(rm_cd) =MIN is used ONLY because they don't GROUP by rm_cd so they need a funct there even that there is only 1 distinct value for rm-cd in that group
Vasc
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply