This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
Ok so I am trying to get the sql down in this example however I feel that the or statements are not correct for example. I want it to show if the SPBPERS_CITZ_CODE = 5 or 6 and its just doesn't seem right. Example blow Tia
select distinct SPRIDEN.SPRIDEN_ID "ID", SPRIDEN.SPRIDEN_LAST_NAME "LastName", SPRIDEN.SPRIDEN_FIRST_NAME "FirstName", SPRIDEN.SPRIDEN_MI "MiddleName", SGBSTDN.SGBSTDN_TERM_CODE_EFF "Term" from SATURN.SGBSTDN SGBSTDN, SATURN.SPRHOLD SPRHOLD, SATURN.SHRTTRM SHRTTRM, SATURN.SPRIDEN SPRIDEN, SATURN.SPBPERS SPBPERS where ( SPRIDEN.SPRIDEN_PIDM = SPRHOLD.SPRHOLD_PIDM ( ) and SPRIDEN.SPRIDEN_PIDM = SHRTTRM.SHRTTRM_PIDM ( ) and SPBPERS.SPBPERS_PIDM = SPRIDEN.SPRIDEN_PIDM ( ) and SPRIDEN.SPRIDEN_PIDM = SGBSTDN.SGBSTDN_PIDM ( ) ) and ( ( SPBPERS.SPBPERS_CITZ_CODE = '5' and SGBSTDN.SGBSTDN_RESD_CODE = 'O' or SGBSTDN.SGBSTDN_RESD_CODE = 'A' and SHRTTRM.SHRTTRM_CAST_CODE ='7' and SGBSTDN.SGBSTDN_STYP_CODE =5 and not SPRHOLD.SPRHOLD_HLDD_CODE = null or SPBPERS.SPBPERS_CITZ_CODE = '6' and SGBSTDN.SGBSTDN_TERM_CODE_EFF = :SGBSTDN_TERM_CODE_EFF ) and ( spriden_change_ind is null ) ) order by SGBSTDN.SGBSTDN_TERM_CODE_EFF desc
Subreddit
Post Details
- Posted
- 8 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/DatabaseHel...