Page 2 of 2

Posted: Tue Aug 02, 2005 11:52 am
by shivan
the second statement doesnt run in sql server. I m trying to run the query i get the error:
Line 1: Incorrect syntax near ')'
thanks
shivan
ray.wurlod wrote:Try these queries against the database.

Code: Select all

SELECT COUNT(*) FROM tablename;
SELECT COUNT(*) FROM (SELECT A,COUNT(*) FROM tablename GROUP BY A);
What do these tell you about grouping?

Posted: Tue Aug 02, 2005 11:58 am
by Sainath.Srinivasan
Give an alias from the sub-table.

Posted: Tue Aug 02, 2005 12:17 pm
by shivan
i still have the same problem. The query i wrote is this:
SELECT COUNT(*) FROM (SELECT a.lf_id,COUNT(*) FROM escalation a GROUP BY a.lf_id)

thanks
shivan
Sainath.Srinivasan wrote:Give an alias from the sub-table.