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 |
sadbjp
INNER JOIN
41 Posts |
Posted - 2007-05-11 : 14:38:50
|
Can we have a query like this:UPDATE RubricReportDetailSET RubricReportDetail.LocalPerf = SPPIndicatorDetails.PctWHERE (RubricReportDetail.IndicatorID = RubricReportTemplate.IndicatorID) AND (RubricReportTemplate.IndicatorNumber = SppIndicator.Number) AND (SppIndicator.SppIndicatorID = SPPIndicatorDetails.SppIndicatorID) AND (SPPIndicatorDetails.FYY = @DataYears) AND (SppTarget.IndicatorNumber = SppIndicator.Number) AND (SppTarget.Years = @DataYears) AND (SppTarget.Part = RubricReportTemplate.Part) |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2007-05-11 : 14:43:54
|
[code]UPDATE rrdSET LocalPerf = sid.PctFROM RubricReportDetail rrdINNER JOIN RubricReportTemplate rrtON rrd.IndicatorID = rrt.IndicatorIDINNER JOIN SppIndicator siON rrt.IndicatorNumber = si.NumberINNER JOIN SPPIndicatorDetails sidON si.SppIndicatorID = sid.SppIndicatorIDINNER JOIN SppTarget stON st.IndicatorNumber = si.Number AND st.Part = rrt.PartWHERE sid.FYY = @DataYears AND st.Years = @DataYears[/code]Tara Kizerhttp://weblogs.sqlteam.com/tarad/ |
|
|
sadbjp
INNER JOIN
41 Posts |
Posted - 2007-05-11 : 14:46:55
|
Tara,Thanks once again. What if I use my query, will it be right? |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2007-05-11 : 14:47:57
|
Did you try it? Does it update the correct data? Does it give syntax errors?Tara Kizerhttp://weblogs.sqlteam.com/tarad/ |
|
|
Vijaykumar_Patil
Posting Yak Master
121 Posts |
Posted - 2007-05-14 : 09:30:43
|
Your Query is wrong. Neither it has a sub query nor it is a join.Necessity is the mother of all inventions! |
|
|
|
|
|