Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
SQLNoob8
Starting Member
5 Posts |
Posted - 2012-07-31 : 11:34:09
|
| 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, |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-07-31 : 11:40:39
|
| if its sql server its just a matter of replacing NUMTIMES_ABANDON in query withSUM(NUMTIMES_ABNADON) OVER (PARTITION BY SiteID,SITENAME,ABANDON_DATE)but you're using Oracle so not sure on thatAlso this is ms sql server forum so there are not enough Oracle experts hereyou may be better of posting this in oracle forums to get oracle related help------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-07-31 : 11:51:09
|
ANSI complaint syntax would beSELECT q.*,q1.NumTimes_Abandon AS YourrequiredcountFROM ( your current query) qINNER JOIN (attached below query)q1ON q1.SiteID = q.SiteIDAND q1.SiteName = q.SiteNameAND q1.Abandon_Date = q.Abandon_Date ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
SQLNoob8
Starting Member
5 Posts |
Posted - 2012-07-31 : 11:54:50
|
quote: Originally posted by visakh16 if its sql server its just a matter of replacing NUMTIMES_ABANDON in query withSUM(NUMTIMES_ABNADON) OVER (PARTITION BY SiteID,SITENAME,ABANDON_DATE)but you're using Oracle so not sure on thatAlso this is ms sql server forum so there are not enough Oracle experts hereyou may be better of posting this in oracle forums to get oracle related help------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/
Thanks alot!It works |
 |
|
|
|
|
|