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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Add a column to existing sql

Author  Topic 

brainsbeautifulsql
Starting Member

1 Post

Posted - 2014-01-06 : 10:31:09
Using Banner and Oracle DB. I have to add pay id to an existing script. One of the table names that pay id exists on is phrhist. I want to add phrhist_pict_code, phrhist_payno to the existing sql below:

select distinct spriden_id as GWID, spriden_last_name as LAST_NAME, spriden_first_name as FIRST_NAME, x.pdrdedn_amount1 as Amount,
x.pdrdedn_bdca_code as BDCA_CODE, x.pdrdedn_ref_no as REF_NO, x.pdrdedn_status as STATUS, x.pdrdedn_effective_date as Eff_Date, pebempl_ecls_code as ECLS
from spriden, pebempl, pdrdedn x, pdrbded, spbpers
where spriden_pidm = pebempl_pidm
and spriden_pidm = spbpers_pidm
and spriden_pidm = x.pdrdedn_pidm
and spriden_pidm = pdrbded_pidm
and x.pdrdedn_bdca_code = pdrbded_bdca_code
and pebempl.pebempl_empl_status = 'A'
and x.pdrdedn_effective_date =
(select max(pdrdedn_effective_date)
from pdrdedn
where pdrdedn_pidm = x.pdrdedn_pidm
and pdrdedn_bdca_code = x.pdrdedn_bdca_code
and pdrdedn_effective_date <= sysdate)
and (pdrbded_end_date > sysdate or pdrbded_end_date is null)
and x.pdrdedn_bdca_code IN ('SMT','SMP','FST','FMP','PK2')
and x.pdrdedn_status in ('A','T')
and spriden_change_ind is null

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2014-01-06 : 12:19:18
SQLTeam.com is for Microsoft SQL Server, so you'll want to post your question on a site that specializes in Oracle or Banner.

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2014-01-07 : 01:00:35
try your luck at www.dbforums.com or www.orafaq.com

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2014-01-07 : 07:35:12
Join with the table phrhist and add required columns in the SELECT statement

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -