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

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 count()

Author  Topic 

crugerenator
Posting Yak Master

126 Posts

Posted - 2007-07-02 : 10:01:13
Lets say I have this select statement...

SELECT count(c_id)
FROM comments
WHERE c_id=#c_id#

#c_id# is a variable in coldfusion.


now, to display the count(c_id) results, what do I do?

usually it would just be #c_id#, but with the count() I can't get it to display. Any ideas?

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-07-02 : 10:06:11
Not clear what you want. Can you explain with expected output and sample data?

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-07-02 : 10:18:21
Do you want to show it in coldfusion?
May be you need to have alias name for count

SELECT count(c_id) as counting
FROM comments
WHERE c_id=#c_id#


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

crugerenator
Posting Yak Master

126 Posts

Posted - 2007-07-02 : 10:21:34
yeah, i figured it out actually.

Its been a long long time since i've used sql, forgot that I could do count(c_id) AS recordCount

That solved the problem.

Thanks
Go to Top of Page
   

- Advertisement -