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.

Filter by
Sorted by
Tagged with
5049votes
27answers
2.5mviews

What is the difference between "INNER JOIN" and "OUTER JOIN"?

Also how do LEFT JOIN, RIGHT JOIN and FULL JOIN fit in?
user avatar
2010votes
3answers
1.9mviews

What's the difference between INNER JOIN, LEFT JOIN, RIGHT JOIN and FULL JOIN? [duplicate]

What's the difference between INNER JOIN, LEFT JOIN, RIGHT JOIN and FULL JOIN in MySQL?
user avatar
  • 30.7k
1901votes
12answers
1.8mviews

LEFT JOIN vs. LEFT OUTER JOIN in SQL Server

What is the difference between LEFT JOIN and LEFT OUTER JOIN?
user avatar
  • 20k
785votes
15answers
905kviews

How can I do a FULL OUTER JOIN in MySQL?

I want to do a full outer join in MySQL. Is this possible? Is a full outer join supported by MySQL?
user avatar
  • 19.4k
227votes
16answers
149kviews

LINQ - Full Outer Join

I have a list of people's ID and their first name, and a list of people's ID and their surname. Some people don't have a first name and some don't have a surname; I'd like to do a full outer join on ...
user avatar
  • 5,660
185votes
4answers
263kviews

Oracle "(+)" Operator

I am checking some old SQL Statements for the purpose of documenting them and probably enhancing them. The DBMS is Oracle I did not understand a statement which read like this: select ... from a,b ...
user avatar
  • 5,346
153votes
7answers
156kviews

LINQ to SQL - Left Outer Join with multiple join conditions

I have the following SQL, which I am trying to translate to LINQ: SELECT f.value FROM period as p LEFT OUTER JOIN facts AS f ON p.id = f.periodid AND f.otherid = 17 WHERE p.companyid = 100 I have ...
user avatar
  • 5,506
109votes
4answers
144kviews

Top 1 with a left join

Given the query below there might be multiple rows in dps_markers with the same marker key but we only want to join against the first. If I take this query and remove the top 1 and ORDER BY I get a ...
user avatar
  • 4,776
92votes
4answers
98kviews

Difference between RIGHT & LEFT JOIN vs RIGHT & LEFT OUTER JOIN in SQL [duplicate]

What is the difference in results between: RIGHT JOIN and RIGHT OUTER JOIN LEFT JOIN and LEFT OUTER JOIN ? Can you please explain it through some examples?
user avatar
  • 8,425
70votes
7answers
503kviews

SQL SELECT from multiple tables

How can I get all products from customers1 and customers2 include their customer names? customer1 table cid name1 1 john 2 joe customer2 table cid name2 p1 sandy p2 linda product table pid ...
user avatar
  • 713
68votes
7answers
205kviews

How to return rows from left table not found in right table?

I have two tables with similar column names and I need to return records from the left table which are not found in the right table? I have a primary key(column) which will help me to compare both ...
user avatar
  • 1,180
59votes
2answers
22kviews

How can we differ LEFT OUTER JOIN vs Left Join [duplicate]

What is the difference between Left Join and Left Outer Join?
user avatar
48votes
5answers
68kviews

Opposite Of An Inner Join Query

can someone help me write sql for a scernerio like this: Table 1 2 columns: ID, Name Table 2 2 columns: ID, Name I want a query to show names from Table 1 that are not in table 2. So filter out ...
user avatar
  • 7,840
36votes
5answers
38kviews

How to do a full outer join in Linq?

I've inherited a database that wasn't designed exactly optimally, and I need to manipulate some data. Let me give a more common analogy of the kind of thing I have to do: Let's say we have a Student ...
user avatar
  • 35.1k
30votes
2answers
12kviews

How does one do a full join using data.table?

In the data.table FAQ, the nomatch = NA parameter is said to be akin to an outer join. However, I haven't been able to get data.table to do a full outer join – only right outer joins. For example: a ...
user avatar

15 30 50 per page
1
2 3 4 5
107