Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
masond
Constraint Violating Yak Guru
447 Posts |
Posted - 2013-06-14 : 08:33:27
|
Hey Guys Sorry to bother you with such a dump question Aim- i need to the get account_Id of the parentsfidThe account_id is based on the #Update.FDMSAccountNo,Parentsfid is the same as the #Update.FDMSAccountNo,i would like to produce a new column called “ Parentaccount_IdThis is my table Select #Address.FDMSAccountNo,Parentsfid,#Update.FDMSAccountNo,#Update.account_idfrom #Address inner join #Update on #Address.FDMSAccountNo = #Update.FDMSAccountNo |
|
bandi
Master Smack Fu Yak Hacker
2242 Posts |
Posted - 2013-06-14 : 09:36:23
|
what is the problem here?--Chandu |
|
|
masond
Constraint Violating Yak Guru
447 Posts |
Posted - 2013-06-14 : 10:36:55
|
HI bandi Okay every Fdmsaccountno has a unique account_id , Every Fdmsaccountno has a parentfid, every parentfid also has an account_idi need to loop back into the table join Parentfid onto fdmsaccountno so i can get the parentfid account_idHope that makes sense |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-06-14 : 10:52:23
|
sounds like this to meif not post some dataSelect #Address.FDMSAccountNo,Parentsfid,u.FDMSAccountNo,u.account_id,u1.account_id as parentidfrom #Address inner join #Update u on #Address.FDMSAccountNo = u.FDMSAccountNoinner join #Update u1 on u.parentfid = u1.fdmsaccountno ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
masond
Constraint Violating Yak Guru
447 Posts |
Posted - 2013-06-14 : 11:06:26
|
Thats exactly what i need thank you very much :) You guys are a saviour :) |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-06-14 : 14:53:21
|
welcome------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
|
|
|