Return To Fordmods Home Page
 Home |  Forums |  Search |  My Profile |  Chat
 Photo Gallery |  Events Calendar |  Technical Documents
 No messages |  New Posts |  Watched Topics |  Register  
Oracle 9 SQL question

 
Post new topic   Reply to topic    Forum Index -> Geeky Bits
 
MikGan
Fordmods - Getting Side Ways



Age:27
Posts: 1230
Joined: 05 Nov 2004
Location: Canberra ACT, Australia

View User Gallery (0)

 
PostPosted: Mon May 01, 2006 1:44 pm    Post subject: Oracle 9 SQL question Reply with quote

Ive got a killer SQL question, I've tried everywhere, Ive searched high and low and no one can help me , so in a last dash of despiration I've posted here...... *dramatic music* so does anyone here fancy them selfs a sql quru and wanna try their hand at solving this sql problem:

http://www.dbforums.com/showthread.php?t=1216229
(ive posted a link to another forum to save me writting it all out again)

if you think you got a solution or even a tip or whatever let me know, here, there, msn whatever, I need a solution!
Back to top
Dellboy999
Fordmods - Getting Side Ways



Age:37
Posts: 1039
Joined: 05 Nov 2004
Location: Melbourne VIC, Australia

View User Gallery (5)

 
PostPosted: Mon May 01, 2006 1:51 pm    Post subject: Reply with quote

why not return counttimes as concatenate of filename, month and year then count that.

You get me.
Back to top
MikGan
Fordmods - Getting Side Ways



Age:27
Posts: 1230
Joined: 05 Nov 2004
Location: Canberra ACT, Australia

View User Gallery (0)

 
PostPosted: Mon May 01, 2006 2:04 pm    Post subject: Reply with quote

sorry dellboy, I dont follow you, sql aint my forte' so I might be a little slow on the uptake icon_razz.gif, bloody games programers!
Back to top
MikGan
Fordmods - Getting Side Ways



Age:27
Posts: 1230
Joined: 05 Nov 2004
Location: Canberra ACT, Australia

View User Gallery (0)

 
PostPosted: Mon May 01, 2006 2:11 pm    Post subject: Reply with quote

It sounds dumb, but Im wanting to count what is NOT in the database, if something has not been downloaded there will be no month entry to group on,.so I'll never see that month in my results.

In short I need to query a daterange from a table and if the a date is not found I want it returned as count = 0.

the other Url explains it a fair bit further.
Back to top
Dellboy999
Fordmods - Getting Side Ways



Age:37
Posts: 1039
Joined: 05 Nov 2004
Location: Melbourne VIC, Australia

View User Gallery (5)

 
PostPosted: Mon May 01, 2006 2:17 pm    Post subject: Reply with quote

OK so you can count the number of entries for a date no problem, it when it has 0 downloads you dont get 0.

So you get:

Feb, 5
Apr, 7

You want:

Jan, 0
Feb, 5
Mar, 0
Apr, 0

Corrrect ?
Back to top
MikGan
Fordmods - Getting Side Ways



Age:27
Posts: 1230
Joined: 05 Nov 2004
Location: Canberra ACT, Australia

View User Gallery (0)

 
PostPosted: Mon May 01, 2006 2:19 pm    Post subject: Reply with quote

exact a mundo
Back to top
Dellboy999
Fordmods - Getting Side Ways



Age:37
Posts: 1039
Joined: 05 Nov 2004
Location: Melbourne VIC, Australia

View User Gallery (5)

 
PostPosted: Mon May 01, 2006 2:26 pm    Post subject: Reply with quote

put the results to a temp table then run a simple loop to fill in tyhe blanks and output the result.

can't think of a better way at the moment
Back to top
MikGan
Fordmods - Getting Side Ways



Age:27
Posts: 1230
Joined: 05 Nov 2004
Location: Canberra ACT, Australia

View User Gallery (0)

 
PostPosted: Mon May 01, 2006 2:28 pm    Post subject: Reply with quote

yeah thats what I can do but it gets complicated cause a result set is immutable so have to read the results into a vector then plug in zero values etc etc, I've been told this 'must' run native on the db itself, so this is the only way... with out mucking around and doing it programatically, and I dont wanna have to do that.
Back to top
Dellboy999
Fordmods - Getting Side Ways



Age:37
Posts: 1039
Joined: 05 Nov 2004
Location: Melbourne VIC, Australia

View User Gallery (5)

 
PostPosted: Mon May 01, 2006 2:32 pm    Post subject: Reply with quote

Oh ok, so basically you are working on read only access to the DB, fair enough then.

Will have to do some more thinking.
Back to top
MikGan
Fordmods - Getting Side Ways



Age:27
Posts: 1230
Joined: 05 Nov 2004
Location: Canberra ACT, Australia

View User Gallery (0)

 
PostPosted: Mon May 01, 2006 2:50 pm    Post subject: Reply with quote

yeah its our www user so read only access
Back to top
Display posts from previous:   
   
Post new topic   Reply to topic    Forum Index -> Geeky Bits
Page 1 of 1

 
 
(c)2002-2009 Matti Jones and Brad Evans

[37 queries :: 0.03151 seconds ]