MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to modify the query
Goto page Previous  1, 2
 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
papadi
Supermod


Joined: 20 Oct 2009
Posts: 594
Topics: 1

PostPosted: Mon Oct 03, 2011 1:48 pm    Post subject: Reply with quote

Have you yet worked with your dba or some senior?

If not, why not?

If you have, what did they say?
_________________
All the best,

di
Back to top
View user's profile Send private message
shyamsaravan
Beginner


Joined: 12 May 2010
Posts: 44
Topics: 12
Location: India

PostPosted: Tue Oct 04, 2011 4:10 am    Post subject: Reply with quote

Hi;
No one helped me..They did not have the answer..so that i came again to Forum
Back to top
View user's profile Send private message
papadi
Supermod


Joined: 20 Oct 2009
Posts: 594
Topics: 1

PostPosted: Tue Oct 04, 2011 1:44 pm    Post subject: Reply with quote

If no one in your organization is capable of doing this in sql, you need to consider an alternative. . .

Even if someone posts what you eventually can use, you should not use it. It is a very bad practice to implement "stuff" that is not understood and will most likely not be maintainable by the local people. If it breaks in production some night, the forum will most likely not be able to fix or rewrite it as fast as you will want.
_________________
All the best,

di


Last edited by papadi on Thu Oct 06, 2011 10:15 am; edited 1 time in total
Back to top
View user's profile Send private message
shyamsaravan
Beginner


Joined: 12 May 2010
Posts: 44
Topics: 12
Location: India

PostPosted: Thu Oct 06, 2011 6:02 am    Post subject: Reply with quote

Hi;

The posted code(Kolusu) is ok with us,the only thing is we have some issues of row returns to the result set..I just explained in the previous post

The query missed some of the records while return to result set..so that i asked again for the doubt...
Below as my getting output
Code:

IN_LOC       PART_NO      MATT_DE     CALEN_YEAR    WKLY_PR     EFF_DT          USER_NAME
----------- ------------ ---------     ------------ ---------- -------------- ------------

ALDDD            6065       AB          2011          100     2011-07-31       JOHN
ALDDD            6065       AB          2011          621     2009-10-22       PETER
ALDDD            6065       AB          2011           -         -              -     <---should not return
ALDDD            6065       AB          2012           -         -                -
ALDDD            6065       AB          2013           0      2013-01-13       RAMESH
ALDDD            6065       AB          2013           -         -              -     <---should not return
                                                                                 
                                                                                      <---2011 rec should return
ALDDD            6065       DE          2012          111     2012-07-28       GOPI
ALDDD            6065       DE          2012          -          -              -     <---should not return
ALDDD            6065       DE          2013          210     2013-07-28       GOPI
ALDDD            6065       DE          2013          -          -              -     <---should not return

ALDDD            6065       FF          2011          -          -              -
ALDDD            6065       FF          2012          -          -              - 
ALDDD            6065       FF          2013          -          -              -
 

                                                                                      <---2011 rec should return
                                                                                      <---2012 recshould return

ALDDD            6065       GG          2013         333     2013-01-04       SAGAR
ALDDD            6065       GG          2013          -           -             -     <---should not return
 
                                                                                      <---2011 rec should return
ALDDD            6065       JJ          2012         300     2012-02-04       SAGAR
ALDDD            6065       JJ          2012          -          -             -      <---should not return
ALDDD            6065       JJ          2013         430     2013-01-04       SAGAR
ALDDD            6065       JJ          2013           -         -              -     <---should not return





Expected output
Code:


IN_LOC       PART_NO      MATT_DE     CALEN_YEAR    WKLY_PR     EFF_DT          USER_NAME
----------- ------------ ---------     ------------ ---------- -------------- ------------
ALDDD            6065       AB          2011          100     2011-07-31       JOHN
ALDDD            6065       AB          2011          621     2009-10-22       PETER
ALDDD            6065       AB          2012           -       -                -
ALDDD            6065       AB          2013           0      2013-01-13       RAMESH

ALDDD            6065       DE          2011           -         -              -
ALDDD            6065       DE          2012          111     2012-07-28       GOPI
ALDDD            6065       DE          2013          210     2013-07-28       GOPI

ALDDD            6065       FF          2011          -          -              -
ALDDD            6065       FF          2012          -          -              - 
ALDDD            6065       FF          2013          -          -              -
 
ALDDD            6065       GG          2011          -          -              -
ALDDD            6065       GG          2012          -          -              -
ALDDD            6065       GG          2013         333     2013-01-04       SAGAR
 
ALDDD            6065       JJ          2011          -          -              -
ALDDD            6065       JJ          2012         300     2012-02-04       SAGAR
ALDDD            6065       JJ          2013         430     2013-01-04       SAGAR
 

Please help me..
Thanks;
Back to top
View user's profile Send private message
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 700
Topics: 63
Location: USA

PostPosted: Thu Oct 06, 2011 2:59 pm    Post subject: Reply with quote

shyamsaravan, in your query this is causing extra rows.

Code:
WHERE C.EFF_DT  >  '0001-01-01'                                     
    OR C.EFF_DT IS NULL

_________________
Regards,
Diba
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group