Returning less number of rows

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

shivan
Participant
Posts: 70
Joined: Mon Jul 25, 2005 9:29 am

Post 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?
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Give an alias from the sub-table.
shivan
Participant
Posts: 70
Joined: Mon Jul 25, 2005 9:29 am

Post 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.
Post Reply