Questions tagged [outer-join]

An outer join defines a relationship between two tables where all records from one or both tables are returned regardless of the existence of a matching key-field in the other table. A full outer join combines the results of both tables. A left or right join returns all the records from the first or second specified table, respectively. NULLS are filled in for matches on either side. A self-join compares a table to a copy of itself.

A full combines the results of both tables. A left or right returns all the records from the first or second specified table, respectively. NULLS are filled in for matches on either side. A compares a table to a copy of itself.

References

1671 questions
5
votes
3 answers

How do I make the join between two streams on Spark structured streaming? - Java 8

I know, join between two streams is not supported yet. But there's a way to do it anyway? Or I need to wait for Spark 2.2.0? Thank you
Aniello Guarino
  • 197
  • 2
  • 10
5
votes
1 answer

How do you combine an inner and outer join in mysql

I can do it in sybase and I can do it in oracle, but I'm not seeing how to do it in mysql. I've got this: (please restrain yourself from re-formatting my sql, last time somebody did that they changed it so it wasn't the same and made the question…
stu
  • 8,461
  • 18
  • 74
  • 112
5
votes
4 answers

LEFT OUTER JOIN and only return the first match

Imagine the following two tables, named "Users" and "Orders" respectively: ID NAME 1 Foo 2 Bar 3 Qux ID USER ITEM SPEC TIMESTAMP 1 1 12 4 20150204102314 2 1 13 6 20151102160455 3 3 25 9 …
Merik
  • 2,767
  • 6
  • 25
  • 41
5
votes
1 answer

Flask-SQLAlchemy Left Outer Join Filtered Query

Initially I was attempting to do a 'Right Outer Join' but once I found out that wasn't supported I began working on coming from the left. However, I'm having trouble figuring out exactly how to write what I need. Essentially I have two tables,…
ThatTechGuy
  • 879
  • 1
  • 10
  • 29
5
votes
6 answers

SQL : FULL OUTER JOIN on null columns

I want to use a FULL OUTER JOIN between two tables on several columns, but when both columns are null, they are not considered as equal during the join, so I obtain two different rows. How can I write my join, so null columns are considered as equal…
bviale
  • 5,245
  • 3
  • 28
  • 48
5
votes
1 answer

nhibernate generate left outer join on many-to-one entity

i'm using nHibernate 2.1.2 and relized that nhibernate will generate left outer join on nested many-to-one entities. it seems start generate left-outer-join on 3rd nested note onwards which start from entity Organization. i have set following in the…
ksang
  • 91
  • 2
  • 4
5
votes
5 answers

For SQL, when did it start to be desirable to always use the words "Inner Join" instead of implicitly joinly?

For SQL, when did it start to be desirable to always use the words "Inner Join" instead of implicitly joining by: select * from t1, t2 where t1.ID = t2.ID; ? Is it just for style or to distinguish between outer join or are there other reasons for…
nonopolarity
  • 146,324
  • 131
  • 460
  • 740
5
votes
2 answers

apply outer() on two lists

I have a list, say exm = list( elm1=c('a', 'b'), elm2=c('b', 'c', 'd'), elm3=c('b', 'c', 'd', 'e')). I want to apply a function on every combination of two elements from exm, e.g., length( intersect( exm$elm1, exm$elm2 ) ). The result should be a…
yliueagle
  • 1,191
  • 1
  • 7
  • 22
5
votes
2 answers

how to write combination of RIGHT OUTER JOIN and LEFT OUTER JOIN

Could any one help me to resolve the below query.. Here we have 1. Left outer join 2. Two right outer join how to combine both right and left O.J and create the same effect as above , I need the same query rewritten , this is because I am…
5
votes
1 answer

FULL OUTER JOIN with filtered data

I seem to have run into a bit of a dilemma on how to best solve this requirement. I realize the issue is very closely related to the following other questions: Problem with Full Outer Join not working as expected What is the difference when adding…
deroby
  • 5,902
  • 2
  • 19
  • 33
5
votes
2 answers

R pairwise product

I'm trying to get the pairwise products of a vector, say a = c(1,2,3,4) What I'm trying to get is 2,3,4,6,8,12 (in that order). I've tried using outer: outer(1:4,2:4) and that gives me a matrix that includes the products I want but I'm not sure…
user2249626
  • 453
  • 2
  • 6
  • 15
5
votes
5 answers

Linq to entities Left Join

I want to achieve the following in Linq to Entities: Get all Enquires that have no Application or the Application has a status != 4 (Completed) select e.* from Enquiry enq left outer join Application app on enq.enquiryid = app.enquiryid where…
Mark
  • 448
  • 1
  • 4
  • 12
5
votes
2 answers

Oracle and SQL Server select (+) equivalent

In Oracle I have: SELECT t2.Regkood, t2.naitatel, t2.naitafaks, t3.lahtiolekuaeg, t1.* FROM table1 t1, table2 t2, table3 t3 WHERE t1.client = t2.client AND t1.client = t3.client(+) AND t1.client = 414246 How do I get the same in SQL Server? thanks
babboon
  • 683
  • 3
  • 20
  • 45
5
votes
2 answers

Full Outer Join Using Each Row Once

I'm wondering if anyone's come across a neat solution to this problem. I'm trying to select data from a couple of tables, having the records match up row by row. I'm basically after a full outer join, but there's one crucial difference. If I have…
JohnLBevan
  • 22,735
  • 13
  • 96
  • 178
4
votes
1 answer

Alternatives to a self FULL OUTER JOIN to obtaint match between two entries

in my db model I have two entities: Entitlement and Entitlement_Data. Each Entitlement is identified by an incrementing ID (IDENTITY), and can have multiple Entitlement_Data entries, each with a different Type - wich can be either 0 (Weekly) or 1…
Andrea Pigazzini
  • 359
  • 1
  • 14