Questions tagged [full-outer-join]

A full outer join combines the effect of applying both left and right outer joins.

Conceptually, a full outer join combines the effect of applying both left and right outer joins. Where records in the FULL OUTER JOINed tables do not match, the result set will have NULL values for every column of the table that lacks a matching row. For those records that do match, a single row will be produced in the result set (containing fields populated from both tables).

279 questions
0
votes
4 answers

SELECT * FROM tableA, tableB WHERE Conditions [+]

I have the following query SELECT * FROM tableA, tableB WHERE Conditions [+] What does this keyword Conditions[+] Stands for? How this query behaves as a outer join?
wali
  • 229
  • 4
  • 8
  • 21
0
votes
2 answers

insert results of join in SQL server 2005

I have two tables with more than 800 rows in each.Table names are 'education' and 'sanitation'.The column name 'ID' is common in both the tables.Now i want to join these both tables as full outer join and i want to save the results of this table as…
7783
  • 373
  • 4
  • 8
  • 27
0
votes
2 answers

Self-Join ... new synthetic columns for values in existing column

I did this once before but don't remember how ... I've struggled with it enough and am now looking for help. I have a table with two columns: Uuid and ProcessId The ProcessId column currently has two values in it: ValueA and ValueB I want to do a…
Ron Alby
  • 1
  • 6
-1
votes
0 answers

I am trying to count route that is frequently used by casual from 2 tables. Code work but only table 1 is counted while table 2 not

I am trying to view most frequent route from 2 table filtered by casual user only and column route that is not null. My code work but it only count route on table 1 and null still shown in route column even though I already add not null in where…
-1
votes
1 answer

How to combine two tables and get rows from first table if there is match in the second table?

I have two tables with the same schema, I want combine both the tables with distinct Id. If there is matching between two tables (with the same Id), then chose Table A Source over Table B Source Table A Table B Id Name…
Ullan
  • 905
  • 4
  • 15
  • 28
-1
votes
2 answers

SQL - How to join 2 tables with combined SUM function ? (Incorrect results currently)

In SQL I'm trying to combine multiple tables and grab the SUM of expenses per person, and sort those by highest total expense first. I have 3 tables: test1 (from grocery store #1) test2 (from grocery store #2), junction1 (one that I just created…
-1
votes
1 answer

Generate Result based on max count in secondary column after a join

I have two tables which have a common key between them, and quite a lot of other important infos ; for the sake of simplicity i will be using Combination A and Combination B. When a combination is met, whichever table has the maximum number of…
Joe_sushi39
  • 11
  • 1
  • 7
-1
votes
2 answers

confused with INNER JOIN and FULL JOIN with temporary table

WITH longest_used_bike AS ( SELECT bikeid, SUM(duration_minutes) AS trip_duration FROM `bigquery-public-data.austin_bikeshare.bikeshare_trips` GROUP BY bikeid ORDER BY trip_duration DESC …
-1
votes
2 answers

find difference between two tables with different keys

I have table A that looks like this : id name a1 A1 a2 A2 b2 B2 and table B that looks like this: volume_id volume_name a1 A1 b1 B1 b2 B2 I want to make a query (or multiple) that would give me the id (or volume_id as…
The Baron
  • 11
  • 1
  • 5
-1
votes
2 answers

Is there a where or group by for after a full outer joint to show the negative?

I’m trying to query a DB sql oracle which combines 2 tables data but shows the locations which have not had any orders. I have created a location_t with the relevant grids by Mile from the main company. I have given the grids a location ID which map…
-1
votes
1 answer

How to combine data from 2 tables -- which join, what conditions?

Consider the following 2 tables. TableDE ID country key1 key2 ------------------------ 1 US 1 null 1 US 1 null 1 US 1 null 2 US null null 3 US 1 1 4 DE 1 1 5 DE …
Pr0no
  • 3,910
  • 21
  • 74
  • 121
-1
votes
1 answer

Joins tables in SQL with uneven rows without duplication

I have two tables in SQL Server GRV and GIV with these columns: GRV : Date, ProductID, ProductName, Unit, ReceivedQTY GIV : Date, ProductID, ProductName, Unit, Quantity Query is as follows: select GRV.ProductID, GRV.ProductName, GRV.Unit,…
-1
votes
1 answer

Multiple Full join is not working in PostgreSQL

I have one select statement with multiple full joins in it. select aroll as aroll, aname as aname, astandard as astandard, amarks as amarks, adepartment_id as adepartment_id, broll as broll, bname as bname, bstandard as bstandard, bmarks as…
-1
votes
1 answer

SELECT in SQL Server to show all distinct rows from the tables OnHand, Sale and Purchase that have either/or Qty field not empty

I need to write a SELECT query in SQL Server which uses a JOIN or UNION that selects distinct ItmNo or Code rows from 3 tables OnHand, Sale and Purchase. Here are the details of the tables I have and what I need. ItmNo and/or Code columns can be…
-1
votes
2 answers

Is there a way to do an If Then statement in the join clause

I have two tables, spend and bookings, that I'm trying to do a full join on. Due to the nature of the tables (not all bookings have spend, and not all spend has a booking_id, and sometimes the wrong booking_id gets assigned), I'd like to do a…