Quantcast
Channel: SQLServerCentral » SQL Server 2014 » Development - SQL Server 2014 » Latest topics
Viewing all articles
Browse latest Browse all 3145

populate different records for duplicate data

$
0
0
I have a table A which has some dataguid fbnum date Type123 234 March 21 II125 256 march 1 IVI have another table say B, the data in B is populated from AID guid fbnum date type 1 123 234 March 2 IIII have two conditions hereits little complicatedif I want to enter the first record of A into Bit should check for (guid and fbnum) in this case its (123 and 234), these records already exists in the table Bso for these type of recordsthe insertion should look like this in table BID guid fbnum date type1 123 234 March 2 III2 123 234 March 2 IIit should replace the date with the most earliest date..if the records(guid and fbnum) doesn't exists in the table it should do a normal insertionID guid fbnum date type1 123 234 March 2 III2 123 234 March 2 II3 125 256 march 1 IVI am not sure if its clear.Thanks

Viewing all articles
Browse latest Browse all 3145

Trending Articles