Re: Query Logic
Date: Tue, 16 Sep 2008 17:04:55 -0700 (PDT)
On Sep 16, 2:11 pm, e..._at_chicagorsvp.com wrote:
> On Sep 16, 3:58 pm, sybra..._at_hccnet.nl wrote:
> > On Tue, 16 Sep 2008 12:29:58 -0700 (PDT), e..._at_chicagorsvp.com wrote:
> > >Hi All,
> > >We've got this data:
> > >FLAG DATE MEMBER_ID
> > >-- --------- -----------
> > >A 12-SEP-08 1072604574
> > > I 03-DEC-07 1072604574
> > >A 09-MAR-07 1072604574
> > >What we want to do is the increment seperate counters for each month
> > >in which the member was active, shows by the letter A.
> > >This data shows that the customer was active on 9/9/07. He
> > >inactivated himself on 12/3/07. Then, he reactivted himself on
> > >9/12/08.
> > >So, we want to have seperate counters for the months the member was
> > >active, which means March/07 thru November /07, then again on
> > >Septermber/08.
> > >Not sure how to actually catch the months between the time he
> > >activated and inactivated. Trying a bunch of IF/ELSE statements, but
> > >that is getting just too crazy to code.......
> > >Any thoughts on this? Even tried a loop for each month, but even that
> > >does not work because even though there is no entry, he was active in
> > >May of 07........
> > >Much Regard
> > Apparently you are mtek.
> > Please don't post the same homework using two different email accounts
> > or nicks.
> > Did you try anything? Apparently not.
> > Joining the table with itself, or using the LAG datawarehouse
> > function, you should be able to get the 'previous' record, and
> > calculate the number of months between two dates.
> > Yes, this answer does require reading documentation, it does require
> > you to do some work, and you badly want others to do your homework for
> > free; I won't fall into that trap.
> > --
> > Sybrand Bakker
> > Senior Oracle DBA- Hide quoted text -
> > - Show quoted text -
> Huh? I'm a bit lost on your comment dude. You don't want to answer,
> that is fine with me. But you should get your balls straight, cuz I
> have no clue what mtek or whatever is......
> Weird guy.....
He did answer. You could google the group for Mtek if you care, which you probably don't. But the relevant point is that you should look up the analytic functions in the docs (or google for blogs or whatever), try some things, then show what you've tried, with scripts that can generate tables and data to replicate your issue. This time of year especially we get people literally wanting us to do their homework for them, and sometimes legitimate workers post similar things and then go "huh?" when told not to post homework questions. If you are not actually Mtek, of course.
Anyways, don't take it personal, welcome to the group, see http://www.dbaoracle.net/readme-cdos.htm for some basic info, and thanks for not flaming on Sybrand's reply.
-- @home.com is bogus. “You can be negative and be wrong year after year and somehow it doesn't create angry critics, but if you're optimistic and incorrect the response is much more vocal.” - Kevin Hassett, economic advisor to John McCain, author of the book “Dow 36,000: The New Strategy for Profiting From the Coming Rise in the Stock Market.”Received on Tue Sep 16 2008 - 19:04:55 CDT