Any SQL Database gurus

Archived from the original Sajha.com — preserved as posted, replies can no longer be added here.
Start a New Discussion
Archived Post

 What is the difference between WINDOW and GROUP BY clause? How do you write the query below in SQL:1999 using WINDOW clause that is without using GROUP BY? p, li { white-space: pre-wrap; } SELECT T.year, SUM (S.sales) FROM Sales S, Times T WHERE S.timeid = T.timeid GROUP BY T.year

refugeeNP · Apr 26, 2011 7:04 PM · 14,033 views

3 Replies

 I am not SQL Database guru but just check this works in your case. SELECT T.year, SUM (S.sales) OVER (PARTITION BY T.year) FROM Sales S, Times T WHERE S.timeid = T.timeid Just give a try..  

open · Apr 26, 2011 7:37 PM

 Nope It didn't work. Also I want it to be using WINDOW clause in SQL 1999. Any help will be appreciated. Also any idea about first qustion??

refugeeNP · Apr 26, 2011 7:56 PM

Why don't you post your questions here. http://www.sqlteam.com/forums/... You might get better help there. 

ketama · Apr 27, 2011 12:20 AM

This conversation is preserved exactly as it was on the original Sajha.com and can't accept new replies.

Start a New Discussion

You might be interested in...

Recent Classifieds View all
Upcoming Events View all
Service Providers View all