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
2 answers

FULL OUTER JOIN with union subqueries

I am trying to create an output with a similar behaviour to FULL OUTER JOIN, with UNION in mysql The queires I am trying to combine are the same with different time frame parameteres EXAMPLE: Select * from ( SELECT GGPORTAL as portal,…
veritaS
  • 511
  • 1
  • 5
  • 23
0
votes
2 answers

Outer join 3 or more tables in Laravel 8

This topic is related to my previews one Join two tables with all records I'm tryng now to join 3 or more tables in my Laravel controller code, and view them in one Datatable. table1 +--------------------+---------+ | recordtime | tempout…
Hristian Yordanov
  • 650
  • 1
  • 6
  • 25
0
votes
2 answers

Using a FULL JOIN in a SELECT, How can I use certain column from a Table but if it is null use a column from another Table?

I have two tables: -- Foo -- -- Bar -- Street | City | Sales Street | City | Purchases X | A | 2 Y | B | 1 Y | B | 3 Z | C | 4 I have to return this: Street | City | Profit 1…
0
votes
4 answers

SQL - How to pick the best available value for each column for each ID from multiple tables?

I have two tables with the same variables referring to attributes of a person. How can I combine data from two such tables picking the best available value for each column from each table for each field? Requirements: For each field, I would like…
Harry M
  • 1,848
  • 3
  • 21
  • 37
0
votes
2 answers

Need Oracle SQL Logic For Comparing Data Between Two Tables :: Like VLOOKUP in Excel

Table1: Acct Cust Owner Name 1111 A111 PRIM Dan Jason 1111 B111 SECO Donna Jason 1111 C111 SECO July Jason Table2: Acct Cust Owner Name 2222 B111 PRIM Donna Jason 2222 C111 SECO July Jason 2222 DD22 SECO Jimmy James I have to compare…
Ram
  • 3
  • 2
0
votes
2 answers

mysql Query to get data from two tables when not exists in either table

I am trying to fetch data from 2 tables, Table A and Table B. Table A has id , name , description. Table B has name , details , sub_details. There are total 10 records in A and 5 Records in B. if I execute a query, select a.id , a.name , b.details ,…
Androing
  • 77
  • 2
  • 9
0
votes
1 answer

Merging some columns from two postgres tables into a new table based on row value

Hello PostgresSQL experts (and maybe this is also a task for Perl's DBI since I also happen to be working with it, but...) I might also have some terminologies misused here so bear with me. I have a set of 32 tables, every one exactly as the other.…
Fowler440
  • 3
  • 1
0
votes
4 answers

How to find combination of intersection from many tables?

I have a list of different channels that could potentially bring users to a website (organic, SEO, online marketing, etc.). I would like to find an efficient way to count daily active user that comes from the combination of these channels. Each…
phost
  • 19
  • 1
  • 4
0
votes
1 answer

Hive - create table by select columns from different tables

Here are my hive tables: table1: |a |b |c | ---------- |a1|b1|c1| |a2|b2|c2| |a3|b3|c3| |a4|b4|c4| |a5|b5|c5| table2: |x |y |z | ---------- |x1|y1|z1| |x2|y2|z2| |x3|y3|z3| |x4|y4|z4| |x5|y5|z5| Desired output: |a |b |x |y…
Vasu
  • 49
  • 1
  • 1
  • 7
0
votes
2 answers

SQLite3 Query COUNT combining two tables

I'm having trouble trying to get my query working as intended, I have two tables (names and classes). Where names has two rows (username and name) & classes has three rows (class, username and time). I'm trying to extract username, name and the…
BodyB
  • 1
0
votes
2 answers

create a table in Redshift by adding columns of the other two tables

I want to create a table in Redshift by adding columns of the other two tables. Table 1 Table 2 Want to create new table on following conditions if table1.sid = table2.sid then t1.totalcorrect+t2.totalcorrect,…
Kavya shree
  • 312
  • 1
  • 7
  • 24
0
votes
2 answers

count(*) doesn't return 0

i have a sql problem ,please help me this is my query select count(category_value .list_value_id) as jobs , category_type.value as category from list_values category_type full outer join params category_value on category_type.list_value_id =…
sahana
  • 9
  • 3
0
votes
1 answer

how to write a SQL to display distinct values of two columns in one row

I have tables a,b. Table a ID In ---------------- 1 Mat1 1 Mat2 2 Mat1 3 Mat3 Table b ID Out -------------- 1 Mat4 2 Mat4 2 Mat5 3 Mat6 I want a result like below. ID In …
kk luo
  • 549
  • 1
  • 9
  • 22
0
votes
2 answers

MySQL sum where inner join is missing from right or left table

I have a turnover table on the one side that has : Storeid Turnover myDate | 1 | 1000 | 2020-01-01 | | 1 | 200 | 2020-01-02 | | 1 | 4000 | 2020-01-03 | | 1 | 1000 | 2020-01-05 | on the other side I have a table with the number…
user5326446
0
votes
2 answers

Evaluate Multiple conditions for same row

I have to compare 2 different sources and identify all the mismatches for all IDs Source_excel table +-----+-------------+------+----------+ | id | name | City | flag | +-----+-------------+------+----------+ | 101 | Plate | NY |…
Avinash
  • 533
  • 5
  • 15