I\'m trying to write an INSERT INTO that does a some DISTINCT/GROUP BY work. The query runs perfectly fine as a select statement, but will not work if it\'s wrapped into an INS
Am I thinking wrong, but is not the sql below equal what you want to achieve?
INSERT INTO MasterRecords(BatchRecordRecordID, SourceID, BatchID) SELECT DISTINCT RecordID, 101, 150 FROM BatchRecords WHERE BatchID = 150 ;