473,382 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Problems with outer joint

Hello,

I'm executing the following query in Oracle 9:

select t1.f1, t2.f2, t3.f3
from t1, t2, t3
where t1.f3=t2.f3(+) and t2.f4=t3.f4
and t1.f1 in (date1, date2, date3)

I expect to get all the dates in the result, but I get only those dates that are not null in table t2.(outer joint is ignored) It happens because of the joint t2.f4=t3.f4

I added the following condition:
and (t2.f4=t3.f4 or t2.f4 is null)
In that case I get all the dates, but
those who have values appear twice -
with the values and empty row

How can I get the correct results with all the dates?

Thank you in advance.
Alexandra
Sep 17 '08 #1
3 1657
amitpatel66
2,367 Expert 2GB
I am not able to understand your requirement clearly. In the previous query you said you are getting only NOT NULL values and in the second you said you are getting values twice, once with NOT NULL and one with NULL. Please mention clearly what you are exactly looking at?
Sep 18 '08 #2
I needed to get the results for all the dates (date1, date2, date3), even if there is no such data in table t2.

I found it may be done if select statement looks like this:

select t1.f1, tt.f2, tt.f5 from t1,
(select t3.f5, t2.f2, t2.f3 from t2, t3 where t3.f4=t2.f4(+)) tt
where t1.f3=tt.f3(+)
and t1.f1 in(date1, date2, date3)

Many thanks for your quick response.

Alexandra
Sep 19 '08 #3
amitpatel66
2,367 Expert 2GB
Good work. :). Good to hear your problem is resolved. Do let us know in case of any further issues
Sep 19 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Matt | last post by:
Hello I have to tables ar and arb, ar holds articles and a swedish description, arb holds descriptions in other languages. I want to retreive all articles that match a criteria from ar and...
0
by: Duncan Jones | last post by:
I'm having some problems placing a table in a section. The problem seems to arise when I have a small section within a section, and then try to place a table in the outer section afterwards. ...
3
by: daveland | last post by:
I am working on some JavaScript that dynamically adds rows to a table in response to a button click. A new row does appear on the screen when the button is clicked. However, that table to which a...
5
by: John | last post by:
Specifically for joint tables... tblStudents tblClasses tblClasses_Students Is it be good programming to use a composite primary key in tblClasses_Students (where the key is ClassID and...
2
by: Lynnemcg1 | last post by:
Hi For a database I have been creating I have been asked to include 6 simple, 6 joint and 6 multiple queries. I'm guessing a simple query is one which includes only one table but what are the...
1
by: Shiro | last post by:
Hi I have read the various postings relating to Interop strong name signing and cannot find an example similar to mine. I have stringly named my AxInterops/Interops and they all work just...
2
by: Amanda | last post by:
please take a look at: shannon.amandadevries.com 1. in firefox, the 'content' div should be starting on the right-hand side of the menublock, not all the way down at the 'copyrightblock'....
4
by: Eric Lilja | last post by:
Hello, consider this program: class Outer { public: class Base { friend class Outer; public: Base(int n) : n_(n) {} protected:
2
by: lrod | last post by:
I'm having an issue with this query. I'm basically running a query where i show two fields using two tables. One will give me the amount and the second one will give me the description. However in my...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.