SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Add a column to existing sql
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

brainsbeautifulsql
Starting Member

USA
1 Posts

Posted - 01/06/2014 :  10:31:09  Show Profile  Reply with Quote
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

USA
37133 Posts

Posted - 01/06/2014 :  12:19:18  Show Profile  Visit tkizer's Homepage  Reply with Quote
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

India
52317 Posts

Posted - 01/07/2014 :  01:00:35  Show Profile  Reply with Quote
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

India
22761 Posts

Posted - 01/07/2014 :  07:35:12  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000