In Reply to: RE: It appears posted by rivervalley817 on October 5, 2020 at 14:30:13:
Correct, group on basename, and since each record in the db has an system generated unique interger "id" attribute, then all I need to select one unique path for each file is to select the minimum ID for each basename.
I could have chosen "maximum" id value, or there are a few other methods to select one arbitray integer value from a group of values using SQL but MIN is easy enough.
This will be an arbitrary choice for which unique path to grab from the DB but since they have identical filenames it should be irrelvant which path to use.
------------------------------------------
;
with deduped as (select basename, min(id) as rowid from [FileInventory].[dbo].[f4] group by basename)
select allfiles.* from [FileInventory].[dbo].[f4] allfiles inner join deduped on allfiles.id = deduped.rowid
This post is made possible by the generous support of people like you and our sponsors:
Follow Ups
- RE: It appears - LtMandella 07:52:03 10/07/20 (0)