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 |
|
landau66
Yak Posting Veteran
61 Posts |
Posted - 2008-08-27 : 16:00:17
|
| hi everyone!I want to see how often specific prices occured during a day. For example 6498.04 occured 27 times, 6505.99 also 27 times and hundred other prices occured as well 27 times. following query helps me finding out the occurence of prices and their occurrence:select count(price)as occ from tbl group by price order by occNow i want to extend this query to find out how often occured the occurrence. In my table I have just the fields: id, datetime, price.Maybe u know how to solve my problem.Many thanks in advance and greetings from Viennalandau |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2008-08-27 : 16:12:54
|
| maybe:select count(occ) as occOccfrom( select count(price) as occ from tbl group by price ) tgroup by occ_______________________________________________Causing trouble since 1980Blog: http://weblogs.sqlteam.com/mladenpSpeed up SSMS development: www.ssmstoolspack.com <- version 1.0 out! |
 |
|
|
|
|
|