Any SQL Database gurus - Sajha Mobile
SAJHA MOBILE
Any SQL Database gurus
Posts 4 · Viewed 12224 · Go to Last Post
refugeeNP
· Snapshot 0
Like · Likedby · 0
 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?

SELECT T.year, SUM (S.sales)

FROM Sales S, Times T

WHERE S.timeid = T.timeid

GROUP BY T.year

open
· Snapshot 21
Like · Liked by · 0
 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..
 

refugeeNP
· Snapshot 39
Like · Liked by · 0
 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??
ketama
· Snapshot 135
Like · Liked by · 0
Why don't you post your questions here. http://www.sqlteam.com/forums/ 
You might get better help there. 
Please log in to reply to this post

You can also log in using your Facebook
View in Desktop
What people are reading
You might like these other discussions...
· Posts 7 · Viewed 2125 · Likes 1
· Posts 1 · Viewed 169
· Posts 2 · Viewed 485
· Posts 1 · Viewed 170
· Posts 1 · Viewed 179
· Posts 1 · Viewed 235
· Posts 1 · Viewed 185
· Posts 1 · Viewed 289
· Posts 1 · Viewed 343
· Posts 1 · Viewed 266



Travel Partners
Travel House Nepal