我正在尝试获取重复项的详细列表,Foldername
即重复值。我需要重复实例和其他相应列的计数,例如FullPath
每个重复实例。
我正在尝试返回每个完整路径的列表及其对应的文件夹名称计数,以及其他列,例如单位、大小等。
FolderName (has the possibility of a duplicate)
FullPath (is completly unique)
我对此进行了一些尝试;在 SQL Server 中,这似乎更明显......但在 Access 中,我有点迷失了。
这是我到目前为止提出的基本 SQL:
/* ''''''''''''''Works but doesn't return Count'''''''''''''' */
Select Snapshot.Unit, Snapshot.FolderName, Snapshot.FullPath
From Snapshot
Where Snapshot.FolderName in
(
Select Snapshot.FolderName
From Snapshot
Group by Snapshot.Foldername
Having Count(Snapshot.FolderName)> 1
)
Order by Snapshot.FolderName, Snapshot.FullPath
这是我想获得的示例输出:
Unit FolderName FullPath Count
BCU Misc C:\blah\blah\blah\Misc 2
ENV Misc R:\blah\blah\blah\Misc 2
CLR Monkey Q:\blah\blah\blah\blah\Monkey 17
ATL Zebra Z:\blah\blah\zoo\Zebra 24