March 1, 2014 at 9:16 am
Kindly help me my requirement?
I have two tables and similar column like (year, week, day, and shifts, Totalvalue)
Table 1 having full data of 2013 but Table2 few weeks of a month.
Also
Some Total value has changed in Table2 for a particular week so here we consider Table2.
Some records having similarly in both table.
Few days missing a week in Table2
Few days missing a week in Table1.
My requirement
Whenever full the records from Table 1 and Table 2 but if data exist in table 2, Get data from table 2 if does not exist get data from Table 1 for passing parameter to particular month.
How to get it..
please give Query for the same. Thanks.
March 1, 2014 at 9:39 am
Based on what you have posted, really can't provide much help.
Please read the first article I reference in my signature block below. Following the instructions in it regarding the information you need to post and how to do it to get the best possible answers to your questions.
March 1, 2014 at 10:49 am
Impossible to "give a query" as Lynn states. You will need to post table definitions with sample data scripts to get a query.
Try full outer joining the two tables on whatever constitutes the primary key.
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
March 1, 2014 at 7:28 pm
manavairajan (3/1/2014)
Kindly help me my requirement?I have two tables and similar column like (year, week, day, and shifts, Totalvalue)
Table 1 having full data of 2013 but Table2 few weeks of a month.
Also
Some Total value has changed in Table2 for a particular week so here we consider Table2.
Some records having similarly in both table.
Few days missing a week in Table2
Few days missing a week in Table1.
My requirement
Whenever full the records from Table 1 and Table 2 but if data exist in table 2, Get data from table 2 if does not exist get data from Table 1 for passing parameter to particular month.
How to get it..
please give Query for the same. Thanks.
Gosh. Isn't this just a simple MERGE or "Upsert" to Table1 from Table2?
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply