sql - Select date which is bigger than another date on a second afinity -
i have 2 identical tables in 2 different dbs ( 1 local , 1 remote ). both of them have datetime
( or datetime2
or else, can still change ) column specifies when added. want records remote table local table have not been brought.
for max value local table, tried put condition where remotetable.createtime > maxlocalvalue
, don't know why seems overwrite records on boundry. better way ? on second or minute level ?
since know values have been added local table, add values remote table not in local table. let local_table repersents local table , remote_table repersents remote table , rcd_1 column in both tables repersents date type.
insert local_table (col_1,.....(how evermany columns need), rcd_1) select rcd_1 remote_table remote_table.rcd_1 <> local_table.rcd_1;
the way explained question suggest newer dates added local remote long hold true should desired results.
Comments
Post a Comment