I would like to know the query where I can get the normal set of columns and add a column that contains the number of records in database..
For example, let's say I have these data..
ColA ColB ColC
---- ---- ----
1AB1 CARR APPL
2BC1 APPL APPL
1AB1 MAXR APPL
from those lines, I would like to generate these columns
ColA ColB ColC Count
---- ---- ---- -----
1AB1 CARR APPL 2
A. This is my current select statement so far..
SELECT top 1 myTBL.* from mydb WHERE ColA = '1AB1'
B. But i couldn't seem to add the following code to get my fourth column..
SELECT count(myTBL.*) as Count from mydb WHERE ColA = '1AB1'
P.S. I would like to get a select statement that combines A and B select statements that I have. The error I'm getting says something about GROUP BY clause.. I'm having a hard time to understand this.. I hope you could formulate the correct select statement I can use for the given example.. Thanks for all the help..