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

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SQL Display TOTAL per day
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

SQLNoob8
Starting Member

USA
5 Posts

Posted - 07/31/2012 :  11:34:09  Show Profile  Reply with Quote
How do I get NUMTIME to show the TOTAL for instead of each by att?

I want that column to display TOTAL for each DAY.

Thanks,

Edited by - SQLNoob8 on 07/31/2012 12:22:02

visakh16
Very Important crosS Applying yaK Herder

India
47084 Posts

Posted - 07/31/2012 :  11:40:39  Show Profile  Reply with Quote
if its sql server its just a matter of replacing NUMTIMES_ABANDON in query with

SUM(NUMTIMES_ABNADON) OVER (PARTITION BY SiteID,SITENAME,ABANDON_DATE)

but you're using Oracle so not sure on that
Also this is ms sql server forum so there are not enough Oracle experts here

you may be better of posting this in oracle forums to get oracle related help

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
47084 Posts

Posted - 07/31/2012 :  11:51:09  Show Profile  Reply with Quote
ANSI complaint syntax would be

SELECT q.*,q1.NumTimes_Abandon AS Yourrequiredcount
FROM 
( your current query) q
INNER JOIN 
(attached below query)q1
ON q1.SiteID = q.SiteID
AND q1.SiteName = q.SiteName
AND q1.Abandon_Date = q.Abandon_Date




------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

SQLNoob8
Starting Member

USA
5 Posts

Posted - 07/31/2012 :  11:54:50  Show Profile  Reply with Quote
quote:
Originally posted by visakh16

if its sql server its just a matter of replacing NUMTIMES_ABANDON in query with

SUM(NUMTIMES_ABNADON) OVER (PARTITION BY SiteID,SITENAME,ABANDON_DATE)

but you're using Oracle so not sure on that
Also this is ms sql server forum so there are not enough Oracle experts here

you may be better of posting this in oracle forums to get oracle related help

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/






Thanks alot!

It works

Edited by - SQLNoob8 on 07/31/2012 12:21:28
Go to Top of Page
  Previous Topic Topic Next Topic  
 New 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.08 seconds. Powered By: Snitz Forums 2000