Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Oracle query help

Avatar of toooki
toooki asked on
DatabasesOracle Database
17 Comments1 Solution467 ViewsLast Modified:
If you could please help with this Oracle (11gR2) query..

I have two tables T1: (about 1000 records)
F1 varchar2
F2 number
F3 number
F4 number
F5 date

And T2: (about 600 records)
F1 varchar2
F2 number
F3 number
F4 number
F5 date

All records in T2 is in T1.

I need to update T1 table's F5 field with the value of T1 table's F5 value when there is a match of T1.F1=T2.F1, T1.F2=T2.F2, T1.F3=T2.F3, T1.F4=T2.F4.

So the Output will return 1000 records (all T1 entries and possibly 600 rows updated with F5 values.)

Now problem is I call it a match if F1 is null in both tables and rest F2, F3, F4 values match.

If I write select T1.F1, T1.F2, T1.F3, T1.F4, T2.F5
from T1, T2
where T1.F1=T2.F1
and T1.F2=T2.F2
and T1.F3=T2.F3
and T1.F4=T2.F4

I do not get the correct output..
ASKER CERTIFIED SOLUTION
Avatar of Pratima Pharande
Pratima PharandeFlag of India image

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 17 Comments.
See Answers