a common task I come across is the need to create a table of "distinct" records based upon "uniqueness" of values in a given field.
SELECT * INTO new_distinct_table FROM [old_non_distinct_table] WHERE [some_unique_field] In (SELECT Max([some_unique_field ]) FROM [old_non_distinct_table ] GROUP BY [non_unique_field_of_interest]);
No comments:
Post a Comment