September 14, 2010 at 12:39 am
Hi All,
I had some problem with getting output.
My criteria is I want to select records which are having
duplicates in name and company name.
Below is the sample data that I have pasted here.
I have a very large table where I need to pull all the records which are having different Emails but with the same Name and company.
Company Name Email ID
TCS Suneethasuneetha@tcs.com 1
TCS Suneethasunitha@tcs.com 2
TCS soumyasoumya@tcs.com 3
TCS soumyasoumya.raja@tcs.com 4
wipro nithanitha@wipro.com 5
infosys GithaGitha@infosys.com 6
SMS vanivani@sms.com 7
SMS umauma@sms.com 8
capgemini vanivani.D@capgemini.com 9
Microsoft UmaUma.fam@microsoft.com 10
I am getting Count easily with the below query.
select name,company,COUNT(*) from tab
group by name,Company having COUNT(*)>1
Problem is I need all the data with all columns
Ex: I need output like this..
Company Name Email ID
TCS Suneethasuneetha@tcs.com 1
TCS Suneethasunitha@tcs.com 2
TCS soumyasoumya@tcs.com 3
TCS soumyasoumya.raja@tcs.com 4
Please help me out in this as I am not at all getting this.Sorry I posted the same in TSQL2005 forum also
September 14, 2010 at 1:31 am
Cross post.. please provide ur solutions at : http://www.sqlservercentral.com/Forums/Topic985259-338-1.aspx
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply