Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 Script Library
 Data Matching
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

33 Posts

Posted - 06/16/2010 :  02:13:09  Show Profile  Reply with Quote
Hi All.
I have a table which has following colums with more than 10 million records.
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.


Yak Posting Veteran

68 Posts

Posted - 06/18/2010 :  20:28:04  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000