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.
| Author |
Topic |
|
lance_carrillo
Starting Member
2 Posts |
Posted - 2007-03-19 : 16:09:04
|
I wrote a simple select query that counts the number of records I have in certain zip codes. How can I get a total of the "count" column at the bottom of the results? For example, my results may look like this:ZIP | (no column name for "count")_____________________________________89502 | 1089509 | 1589521 | 25What statement would I use to get the total of '50' displayed in the resluts? Thank you in advance -Lance |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
chiragkhabaria
Master Smack Fu Yak Hacker
1907 Posts |
Posted - 2007-03-19 : 16:22:12
|
| Means you want to display 50 at the button of the screen??? then you use compute by clause. if you just want to get the 50 as result then you have to use sub query.. Give the query through which you got this result, then we may able to help you out..Chiraghttp://chirikworld.blogspot.com/ |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-03-19 : 16:26:02
|
| You also could calculate the footer information in the front-end application.Peter LarssonHelsingborg, Sweden |
 |
|
|
lance_carrillo
Starting Member
2 Posts |
Posted - 2007-03-19 : 16:26:10
|
| That worked perfectly! Thank you very much. I do have access to books online but very new to SQL and was not sure how to find the answer to this question. I truly appreciate your help! |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-03-19 : 16:33:50
|
| Books Online is installed together with your client tools.Highlight the keyword in query window and press SHIFT+F1Peter LarssonHelsingborg, Sweden |
 |
|
|
jezemine
Master Smack Fu Yak Hacker
2886 Posts |
|
|
|
|
|