Any SQL Database gurus - Sajha Mobile
SAJHA MOBILE
Any SQL Database gurus
Posts 4 · Viewed 5200 · 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 3 · Viewed 270
· Posts 1 · Viewed 77
· Posts 19 · Viewed 3144 · Likes 1
· Posts 1 · Viewed 96
· Posts 1 · Viewed 82
· Posts 1 · Viewed 128
· Posts 1 · Viewed 137
· Posts 4 · Viewed 1145
· Posts 1 · Viewed 255
· Posts 1 · Viewed 164



Your Banner Here
Travel Partners
Travel House Nepal