Can anyone help me in combining the data in 1st set to the one in 2nd set. WID,LID are key columns in the set.
Attachments: Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.
What do you want as the output?
A data set of 9 rows? If so use a union
A set of matching data from both tables? (3 rows) use a INNER JOIN
A set of matching data from one table, and any matching data from the second? (6 rows with nulls) use an OUTER JOIN
1st set of 6 records are from original table and script should combine records into bottom 3 records .
For each WID,LID if startdate of 2nd record is immediate date of previous enddate ,we need to merge those records into a single record
Please post in a picture in excel or something what you want the output to look like
21 People are following this question.
T-SQL Create Query - Compare and Calculate
Help to Optimize a Frequently Ran Query
Pivot Function in SQL Server
SQL Query and SQL Server License - calculation
Tuning SQL Query - Running too long