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.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Row Grouping

Author  Topic 

pssumesh2003
Starting Member

35 Posts

Posted - 2010-01-09 : 02:23:34
Hi Everybody
Happy New year!

I Have a problem. I want to get count of customer with their profession
. But In this databse having more than 5000 customers. Here problem is
due to Spelling mistake and Word entereing diffrerence ie
Goverment Employee is enter in db like Goverment Employ,Govt Employ,Govt EMpl,etc etc .
so many rows are there in table having same profession.

How can i group by this using any string methods
Please Help me.

Table structure
Id,Name,surname,Profession,dob,dateofjoining

karthik_padbanaban
Constraint Violating Yak Guru

263 Posts

Posted - 2010-01-09 : 05:36:55
post some sample data in the database and the sample for the result you want.

Karthik
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-01-09 : 10:30:34
quote:
Originally posted by pssumesh2003

Hi Everybody
Happy New year!

I Have a problem. I want to get count of customer with their profession
. But In this databse having more than 5000 customers. Here problem is
due to Spelling mistake and Word entereing diffrerence ie
Goverment Employee is enter in db like Goverment Employ,Govt Employ,Govt EMpl,etc etc .
so many rows are there in table having same profession.

How can i group by this using any string methods
Please Help me.

Table structure
Id,Name,surname,Profession,dob,dateofjoining


then you need to create a mapping table and map current values to correct category and group on that.
for example you will a record called Government Employee in new table and you map all of Goverment Employ,Govt Employ,Govt EMpl,etc etc from old table to it and group on it.
Go to Top of Page
   

- Advertisement -