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
 General SQL Server Forums
 Script Library
 Data Matching

Author  Topic 

Frozen_123
Starting Member

33 Posts

Posted - 2010-06-16 : 02:13:09
Hi All.
I have a table which has following colums with more than 10 million records.
COLA
COLB
Now situation is I have some 3000 rows in excel with COLA format mentioned with above table. I need to check the occurence of every row in excel file to our actual sql table as below format.

COL A No. of occurence with actual sql table
dffrddd 10
BRdertt 2
bt45fcdw 5

I can see with count(*) I can count the no. of occurences in actual table but not sure how to fetch the corresponding value for COLA. I can define the logic to fetch the output as above mentioned format but not very much handy with T-sql scripting.

Could anyone please help me asap.

Thanks in advance.

Regards,
Frozen

pduffin
Yak Posting Veteran

68 Posts

Posted - 2010-06-18 : 20:28:04
Not sure that I understand your question or if it's harder than I imagine. If it's the simple answer then maybe this will work:

select colA,count(*)
from <Your Table>
group by colA
Go to Top of Page
   

- Advertisement -