Home » SQL & PL/SQL » SQL & PL/SQL » dynamic update of columns based on rows of other columns (oracle 10g)
dynamic update of columns based on rows of other columns [message #396224] Sun, 05 April 2009 04:40 Go to next message
yadavendra.singh
Messages: 2
Registered: April 2009
Location: hyderabad
Junior Member
Hi support



i have three tables in my excel sheet table 1 as exp5,table 2 exp6,table3 exp 7,

The desired output table based on table 2 conditions based on flag like appplicable
"Y" or "NA"

For ex in exp5 the original table and exp6 the conditions table

If the value is "Y" in applicable column of table 6 then
need to populate the corresponding values for rule1 of exp5 table or else it is "NA" in exp6 table then i need to show exp5 values as 'NA'

Here if iam using the table in other way of excel sheet table 3 iam getting the desired results if iam using the table 2 iam not getting the desired output



check this query which is working fine for desired ouptut if i use table 1 and table 3





select rules,region1,busndate1
from
(
select exp5.rules,decode(exp7.region,'Y',exp5.region,'NA','NA') region1,
decode(exp7.busndate,'Y',exp5.busndate,'NA','NA') busndate1 from
exp5,exp7 where exp5.rules=exp7.rules)



now i want to have the same result with table 1 and table2 here i know i need to do a transpose of table 2 which iam doing but could not get the desired result please can u check this query and send me asap.





regards

Yadavendra singh Confused
Re: dynamic update of columns based on rows of other columns [message #396226 is a reply to message #396224] Sun, 05 April 2009 05:01 Go to previous messageGo to next message
yadavendra.singh
Messages: 2
Registered: April 2009
Location: hyderabad
Junior Member
please find the attcahed text file
Re: dynamic update of columns based on rows of other columns [message #396242 is a reply to message #396224] Sun, 05 April 2009 10:43 Go to previous message
BlackSwan
Messages: 25050
Registered: January 2009
Location: SoCal
Senior Member
You need to help us by following the Posting Guidelines as stated below.
http://www.orafaq.com/forum/t/88153/0/
Please, please, please Read & Follow Posting Guidelines above.
Go to the section labeled "Practice" & do as directed.

[Updated on: Sun, 05 April 2009 10:44]

Report message to a moderator

Previous Topic: crazy usage with association table cause ORA-06500: PL/SQL: storage error
Next Topic: Enquiries on searching date using Between function 'merged 3)
Goto Forum:
  


Current Time: Sat Dec 10 04:54:03 CST 2016

Total time taken to generate the page: 0.08267 seconds