Home » SQL & PL/SQL » SQL & PL/SQL » IF or CASE
IF or CASE [message #242669] Mon, 04 June 2007 11:18 Go to next message
russki
Messages: 14
Registered: May 2007
Junior Member
Hello,

How would you insert the 1st statement (and be read as IF or CASE) into the 2nd Script?



All the testing Im doing are all in TOAD!!!

1st
SELECT
g.cust_name

FROM
F_ACCT_TRX_HIST_STG2 a
,FINMART.D_CUSTOMER g
,dssmart.f_sales_invoice h
WHERE
(a.gl_tr_type = 'SO'
AND a.gl_doc = h.inv_nbr
AND h.inv_cust_bill_to_nbr = g.cust_nbr)



2nd

SELECT b.en_ent
,e.sa_sub
,c.cc_cstctr
,SUM(a.gl_amt)

FROM F_ACCT_TRX_HIST_STG2 a
,D_ENTITY_STG2 b
,D_COSTCTR_STG2 c


WHERE a.gl_ent = b.en_ent
AND c.cc_cstctr = UPPER(a.gl_cc)
AND e.sa_sub = a.gl_sa


GROUP BY b.en_ent
,e.sa_sub
,c.cc_cstctr

Re: IF or CASE [message #242672 is a reply to message #242669] Mon, 04 June 2007 11:24 Go to previous message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Please read and apply How to format your posts and How to get a quick answer to your question: TIPS AND TRICKS
Please post your Oracle version (4 decimals).

Regards
Michel
Previous Topic: Rownum
Next Topic: Inner Join example
Goto Forum:
  


Current Time: Sat Dec 03 18:09:41 CST 2016

Total time taken to generate the page: 0.09739 seconds