Hi SQL guruz,
I am just a beginner in the SQL and have a little problem.
I have an query which works flawlessly and return the expectant results. It looks like:
Now. I am not interested in the content of the result. I just want to know, how much rows this query will return. I tried to enclose all that query in the other, but it does not work. I get the syntax error instead of count of rows. This what I have tried:
What I am doing wrong?
Thanks in advance, Roman G., Prague
I am just a beginner in the SQL and have a little problem.
I have an query which works flawlessly and return the expectant results. It looks like:
Code:
select idchain from chains
group by 1
having count (idchain) > 1
Now. I am not interested in the content of the result. I just want to know, how much rows this query will return. I tried to enclose all that query in the other, but it does not work. I get the syntax error instead of count of rows. This what I have tried:
Code:
select count (*) from (
select idchain from chains
group by 1
having count (idchain) > 1
)
What I am doing wrong?
Thanks in advance, Roman G., Prague