Category "join"

Excel and Power Query: Merge Using Most Recent Date

I was able to merge(inner join) a transaction table with an owner info table using account number as my key to get the following results: I need the transactio

LEFT JOIN query returns only results existing in table 2

I would like to improve an existing (php/mysql) codebase that presents an overview of choir attendances (X axis: dates, Y axis: students). The data is spread ac

SQL CROSS JOIN with WHERE CLAUSE not returning anything

I am trying to get a result for the query: SELECT product, exportcountry FROM is_exported_to CROSS JOIN is_produced_in WHERE product = cheese AND origin = 'Fran

Need to match ClockIn with Clock out, multiple clocks on same day SQL

I'm trying to get the clock in and clock out times to correspond to each other so that I can calculate hours worked/amount of breaks/time worked within working

Recursive query to produce edges of a path?

I have a table paths: CREATE TABLE paths ( id_travel INT, point INT, visited INT ); Sample rows: id_travel | point | visited -----------+-------+

SQL Join is Returning Multiple Rows

Below is a Snowflake query that is trying to get the serial number that's associated with each account name (ACCT_NAME), account ID (ACCT_ID), SKU ID (SKU_ID_p2

Join to another table only matching specific records

I have a table of ports: drop table if exists ports; create table ports(id int, name char(20)); insert into ports (id, name ) values (1, 'Port hedland'),

SQL query based on another table

I have tables like this: table 1: FNAME ID1 FID BREAD XYZ 18BREAD FISH ABC 45FISH BREAD_OLD BNQ 18BREAD_OLD BACON TBG 77BACON EGGS CGS 99EGGS BANANA BHG BANANA

Pandas Merging 101

How can I perform a (INNER| (LEFT|RIGHT|FULL) OUTER) JOIN with pandas? How do I add NaNs for missing rows after a merge? How do I get rid of NaNs after merging?

Join 4 tables across 2 databases - Getting duplicates

Objective: Pull report usage statistics from MS SSRS ReportServer database. Then, link to another table in a separate database (same server) to pull in employee

Computing number of business days between start/end columns

I have two Dataframes facts: columns: data, start_date and end_date holidays: column: holiday_date What I want is a way to produce another Dataframe that has

Formula to create a row for every value of a comma-delimited list - GSheets

I am trying to write a formula that will take a set of columns and pair them into separate rows with a comma-delimited list. In SQL, I would do this with a left

Selecting all rows from t1 join t2 on id and select the lowest value from t2 or null if not any

I have two tables, one holds some categories and the other holds players' records like so: Categories Times id Name id UserId MapId Categ

Access Query Left join with Inner join and 'And' Clause

I have 3 tables I'm trying to join, and the final table may be missing a record. I'm trying to determine if it's there or not. Notice how table 3 doesn't have a

SQL Join tables - join with last four digits of columns

I'm trying to join two tables in SQL. I want to join on the column with the last four digits of a phone number with the a column from a second column where only

Making a MySQL COUNT query

after 4 days of tries and researchs over the web I can't make my wishes working. Any help would be appreciated !Performed on MYSQL WORKBENCH I got a DB made of

SQL Query with 2 conditions but from different tables

I have the below query that has only one condition, which is if the companies are included in the table, then mark them as "Yes" under [Competitor] column, if t

SQL query question, how to make a query that outputs all entries of two tables

I have two tables, CITIES and FLIGHTS: CITIES id name 1 New York 2 Paris 3 Tokyo 4 Amsterdam FLIGHTS id departure_id arrival_id 1 1 2 2 1 3 3 2 3 4 2 4 I ne

MantToMany - Cannot add or update a child row: a foreign key constraint fails

I am trying to create Many to Many relationship and save some data to database. I have entities: @Data @AllArgsConstructor @NoArgsConstructor @Entity public cla

SQL returning all rows and count

I have 3 tables, Property managers, Addresses and Units. I'm trying to get all the rows using the aggregate function COUNT, but it only returns 1 row. I want to