September 7, 2010 at 3:42 am
Hi,
CREATE TABLE #tblImage (
ImageID int IDENTITY(1,1) NOT FOR REPLICATION NOT NULL,
[Image] image NOT NULL,
[FileName] varchar(100) NOT NULL,
FileExtension varchar(3) NOT NULL)
INSERT INTO #tblImage ([Image],[FileName],FileExtension)
VALUES ('0x307837383738373','image01','jpg')
INSERT INTO #tblImage ([Image],[FileName],FileExtension)
VALUES ('0x307837383738373','image02','jpg')
INSERT INTO #tblImage ([Image],[FileName],FileExtension)
VALUES ('0x3078333037383337333833373338333733','image03','jpg')
Consider the above table. Can any one please give me a query to find the duplicate images?
Note : Duplicate Filename is allowed.
Thanks
Selvam
September 7, 2010 at 4:02 am
Cast your IMAGE column to VARBINARY(MAX), which is compatible with DISTINCT and ROW_NUMBER().
See also http://msdn.microsoft.com/en-us/library/ms187993.aspx
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply