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 Suneetha suneetha@tcs.com 1
TCS Suneetha sunitha@tcs.com 2
TCS soumya soumya@tcs.com 3
TCS soumya soumya.raja@tcs.com 4
wipro nitha nitha@wipro.com 5
infosys Githa Githa@infosys.com 6
SMS vani vani@sms.com 7
SMS uma uma@sms.com 8
capgemini vani vani.D@capgemini.com 9
Microsoft Uma Uma.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 Suneetha suneetha@tcs.com 1
TCS Suneetha sunitha@tcs.com 2
TCS soumya soumya@tcs.com 3
TCS soumya soumya.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