Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
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.
SELECT [NAMES], [NUMBER]FROM [CV].[dbo].[T40]WHERE [NUMBER] = '44644'GROUP BY [NAMES], [NUMBER];
the output is:[CODE]NAMES NUMBER BENCORE S.R.L. 44644BENCORES.R.L. 44644[/CODE]I need instead this other output, can you help me?
NAMES NUMBER BENCORE S.R.L. 44644
James K
Master Smack Fu Yak Hacker
3873 Posts
Posted - 2013-08-30 : 13:14:28
[code]SELECT MIN([NAMES]) AS [NAMES], [NUMBER]FROM [CV].[dbo].[T40]WHERE [NUMBER] = '44644'GROUP BY [NUMBER];[/code]
visakh16
Very Important crosS Applying yaK Herder
52326 Posts
Posted - 2013-08-31 : 05:16:49
ideally you would like to do some kind of fuzzy grouping to get these similar names grouped together. If you want you can run a MDM type logic to create standardized value out of these duplicate pattern.Taking MIN may not always give you result you're after as there may be completely different entities whom you may need to list out separately------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs