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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 .NET Inside SQL Server (2005)
 Generating Frequency Distribution
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Mohammed Saleem
Starting Member

2 Posts

Posted - 11/29/2011 :  00:58:25  Show Profile  Reply with Quote
Hi All,

I am new to the sql server and just started with it.
I have sql server 2005 and visual studio 2008 installed on my system.

I have stock market data for past 1 year where i need to generate frequency distribution for a particular column.

Since i am new m not getting any idea of how to accomplish this task.
Since I am new, I have no much idea of stored procedure. Any other easy logic will be of great help.

Can U plz help in this issue.

Your Help Appreciated.

Thanks,
Saleem

tkizer
Almighty SQL Goddess

USA
38200 Posts

Posted - 11/29/2011 :  01:08:03  Show Profile  Visit tkizer's Homepage  Reply with Quote
Where is this data? Is it already in a SQL Server table? If so, please provide the layout, sample data, and expected output. If it's not already in a table, is it in a formatted file? Please provide more details so that we can help you.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

Mohammed Saleem
Starting Member

2 Posts

Posted - 11/29/2011 :  01:20:23  Show Profile  Reply with Quote
Hi Tara,

The data is already in the SQl Server, I want to display the caluclated frequency distribution table in ASP page according to the date range that has been selected.

result(%)
0.00,0.17,-1.59,-0.18,0.66,-0.88,-1.14,1.41,-0.58,-1.67,4.42,-1.54,
-1.73,-4.96,2.69,1.41,0.94,-4.13,-3.63,1.39,0.58,1.72,-3.60,1.78,
-0.69,1.07,-0.55,1.82,0.86,1.51,-0.42,0.19,-0.62,-0.62,-1.68,1.83
0.67,1.30,2.14,-0.07,0.23,0.66,3.91,0.06,1.80,0.82,0.29,0.49,-1.22,
0.27,-0.15,0.24,-1.07,1.12,1.61,0.44,-1.19,1.88,0.65,1.49,-0.36,
0.41,1.07,0.44,0.44,0.27,0.77,0.21,0.06,1.34,1.31,-0.61,-0.13,-1.00,
5.98,2.80,1.64,-0.49,-2.77,-0.17,2.69,-2.81,2.01,-2.88,-1.04,-3.80
and so on..

Expected Output:
Bin Frequency Relative Frequency
-4.09 8 2%
-2.59 16 4%
-1.09 66 14%
0.39 164 36%
1.89 153 33%
3.39 39 9%
4.89 7 2%
6.39 3 1%
7.89 1 0%


Is this info helpful?

Thanks,
Saleem
Go to Top of Page

tkizer
Almighty SQL Goddess

USA
38200 Posts

Posted - 11/29/2011 :  22:33:27  Show Profile  Visit tkizer's Homepage  Reply with Quote
Please show us your table layout.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000