I am new in using SQL. My problem is as follow:
Table-A has two date columns. They are date1 and date2.
Table-B has just one date column.
I have to take date1 from Table-A and find a equal date from Table-B. If found, Return the date from the next record (from Table-B).
The value returned from Table-B will then be compared with Date2 (From Table-A). If these dates are not equal, then insert the value of Date1 and Date2 to Table-C.
Can this be possible done with Stored Procedure? Example please.
Thank you in advance.