Home Computer Audio Asylum

Music servers and other computer based digital audio technologies.

RE: It appears

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:
  Parts Connexion  


Follow Ups Full Thread
Follow Ups
  • RE: It appears - LtMandella 07:52:03 10/07/20 (0)

FAQ

Post a Message!

Forgot Password?
Moniker (Username):
Password (Optional):
  Remember my Moniker & Password  (What's this?)    Eat Me
E-Mail (Optional):
Subject:
Message:   (Posts are subject to Content Rules)
Optional Link URL:
Optional Link Title:
Optional Image URL:
Upload Image:
E-mail Replies:  Automagically notify you when someone responds.