Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
TomekK
Starting Member
3 Posts |
Posted - 2005-07-29 : 10:43:37
|
| hiim new herei want to create some appcation which helps me with my mp3 files databasenow i have code which insert all files name from catalog to databasetable has name Filesand columns areID ( file id - unique )fileCreationTime ( time of file creation)fileSize ( filesize)fileName ( filename)fileInsertedBy (forein key to user)fileIndertDate ( date.now)all of this information are inserting automatic from catalog which has mp3 filesand nowi want to find duplicate of filesbut name of dulicate files are other...forexamplefitalic - other.mp3fitalic-other.mp3fitalic_-_other.mp301fitalic-other.mp301fitalic - other.mp302_fitalic_-_other.mp3fitalic_-_other.mp3all names of this files are duplicated for mei have Regular Expression which describe filename[0-9]+( |_|)+[a-zA-Z]+( |_)+(-)(((_| )+[a-zA-Z]+)+)\.(mp3)when files are inserting to database from catalogi want to see duplicated filemy ideas arecheck string after producer name in this case (fitalic - other.mp3) it is "other.mp3"if they are similar -> check producer nameif producer name & title are similarit means that file is duplicatedother ideasplit producer name and titletable will be( ID ProducerName Title)i still don't know how to find duplicate.....maby some one help me...thanks in advance |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2005-07-30 : 11:02:29
|
| splitting the data into producer and title will probably be the better solution, not to mention normalized. You can then use select producer,title,... from mytable wheretitle in (select title from myTablegroup by title where count(*)>1)the result will show records which have occured more than onceHTH--------------------keeping it simple... |
 |
|
|
TomekK
Starting Member
3 Posts |
Posted - 2005-08-01 : 04:13:07
|
| hiyour query will be good (i think) only when i split producer and title ?when i use this for query bellowselect filename from myTable where filename in(select filename from myTable group by filename)he gives me all records from tableand when i add "...where count(*)>1"sql server gives me some errorthanks |
 |
|
|
TomekK
Starting Member
3 Posts |
Posted - 2005-08-01 : 04:22:51
|
| and when i split producer name and titleand use this queryselect producer,title from Files where title in(select title from Files group by title)it's work but he gives me all records... not similar...."where" still doesnt work |
 |
|
|
|
|
|