43,868 questions
-1
votes
0
answers
54
views
Join two date tables (hive) [closed]
enter image description hereI have two tables that I need to join together and i'm possibly overthinking the issue.
Baseline table has a entry for each month. In the actual table most applications ...
Advice
0
votes
0
replies
38
views
Qgis Many-to-One (m:1) Join
I have the following issue: I have a line and polygon layer, and I want to add every polygon feature to the lines they intersect. Every line should then have new columns, e.g.:
id_polygon_1; ...
0
votes
1
answer
91
views
How to left_join across multiple timepoints in long format [closed]
I'm trying to left_join data2 to data1, so that I end up with data3
data1 <- data.frame(ID = 1:4,
Time = 0,
X1 = c("a1", "a2", "...
-8
votes
1
answer
133
views
What is the method to combine multiple sheets when there are no common fields? [closed]
I am uncertain about how to merge data from multiple sheets using only the file name, especially when the file names vary in case.
C:\Report\overview.csv:
overview.csv.
Issue Name, Issue Type, Issue ...
-1
votes
1
answer
58
views
How to Join two RDDs in pyspark with nested tuples
I need to join two RDDs as part of my programming assignment. The problem is that the first RDD is nested, while the other is flat. I tried different things, but nothing seemed to work. Is there any ...
3
votes
1
answer
129
views
Use pandas merge_asof to achieve inexact left join
I have two pandas series:
right_series
Index
Value
1
0.1
2
0.2
3
0.3
6
0.6
7
0.7
left_series
Index
Value
1
0.1
5
0.5
10
1.0
I would like to join right_series on left_series by the indices, such that ...
Advice
0
votes
2
replies
68
views
How split hash-join in Trino into more parts?
I have a query with join. When Trino has 10 workers it works. When 5 - it fails. As I understand the situation (Trino call this DistributedHashJoon) - it splits entire table into 10 pieces, so smaller ...
1
vote
1
answer
153
views
Make MySQL evaluate subquery first
SELECT tt.trans_type_name AS transaction_type,
trans.transaction_time,
a.trans_action_name AS transaction_action_name,
trans.transaction_notes
FROM(SELECT Cast(...
1
vote
1
answer
115
views
Avoid invalid cast inside CASE expression, in a query plan not respecting JOIN
I'm trying to get partitioned tables from a postgres DB. Our partitions have the date in them in various formats which I'm extracting like this
SELECT tab.relname AS table_name,
(CASE
...
-1
votes
0
answers
41
views
Pandas merge on one of two criteria [duplicate]
I have a table/df that holds a set of code and value pairs. The codes are a mix of old (legacy) and new codes due to process changes. I have a second table/df that holds the old codes, new codes, ...
Best practices
1
vote
0
replies
76
views
Kotlin Exposed SQL query data with children - N+1 issue
Currently, we have a lot of code like this one to query data inside our repositories:
database.suspendedTransaction {
Items
.selectAll()
.where { Items.userId eq userId }
....
5
votes
4
answers
226
views
UPDATE with LEFT JOIN and condition IS NULL
I have the following table definitions:
Table public.messages:
Column
Type
Collation
Nullable
Default
ip
text
msg
text
ignore
boolean
Table public.host:
Column
Type
Collation
Nullable
Default
ip
text
...
3
votes
0
answers
166
views
Why polars join function performance deteriorates so much from version 1.30.0 to 1.31.0?
I noticed a significant performance deterioration when using polars dataframe join function after upgrading polars from 1.30.0 to 1.31.0. The code snippet is below:
import polars as pl
import time
...
2
votes
1
answer
139
views
Find differing rows between two Polars DataFrames based on ID and multiple columns
I have two Polars DataFrames (df1 and df2) with the same columns.
I want to compare them by ID and Iname, and get the rows where any of the other columns (X, Y, Z) differ between the two.
import ...
0
votes
7
answers
355
views
Conditional Join in SQL query
I need a single SQL query that would satisfy the below criteria.
I have 2 tables, say Table1 with these values:
ID
Code
Description
1
1000
abc
2
1000
pqr
3
1000
efg
4
2300
rst
5
2300
uvw
6
2930
xyz
7
...
2
votes
1
answer
67
views
How to join a pivoted table with other tables
I’m working with the DolphinDB Python API to analyze financial data, but I can’t join a table transformed by pivotby() with another table directly. The error says TablePivotBy has no merge attribute. ...
0
votes
0
answers
52
views
join not merging data from both tables rapidminer
I am trying to join two outlier tests, by attribute id, the outliers discovered from LOF_Outliers and the outliers discovered from Distance_Outliers.
But only one of these two outliers is showing:
...
2
votes
0
answers
90
views
Join API endpoints and write out result
I would like to join endpoints and return result (in Wordpress). After I get the results, I want to import with WP All Import plugin, Hotels and Locations. I'm using Traveler theme.
The API is: https:/...
0
votes
0
answers
39
views
Trying to update data type in Tableau from string to numerical but column is still being treated as a string
I'm trying to resolve an issue in Tableau Public where I'm trying to change string data to numerical data in a table, but the change won't stick.
I'm trying to join two tables in Tableau based on the ...
2
votes
2
answers
129
views
R data.table rolling join with limit window in number of data points
dates = as.Date(c('2000-01-01','2000-02-01','2000-03-01','2000-04-01'))
dt = data.table(date = dates[1:2], value = c(1,2))
> dt
date value
<Date> <num>
1: 2000-01-01 ...
0
votes
2
answers
141
views
Pandas merge one-to-many [duplicate]
I'm trying to merge two pandas DataFrames on multiple columns. It is a many-to-one relationship. There are many of the same values in df1 but only value in df2.
These are the example DataFrames :
df1 =...
2
votes
1
answer
104
views
SELECT query over 4 tables including MAX function in JOIN
I have 4 tables in a mysql database:
Results
Result_ID
Season_ID
1
1
2
1
4
2
4
2
…
…
37
5
38
5
Players
Player_ID | Player | Player_Type | Player_Order
1 Fred Defender-Left 1
2 ...
0
votes
0
answers
42
views
Performance issues when combining queries with multiple selects [duplicate]
I have 2 queries with the same 3 related tables and each one works fine separately. But I would ideally like to combine them into one query. So this one:
select me.id, me.title, me.start_date_time,
...
2
votes
3
answers
146
views
How to left join two datasets in r based on several conditions? [closed]
I have two datasets (Each dataset around 1.8M rows), one contains per second data, and the other one sometimes have per second, every two second, or three second. I wanted to join these two datasets, ...
0
votes
0
answers
59
views
What is the correct syntax for querying many-to-many relationships in FetchXML when the intersect table is not directly accessible?
I'm trying to retrieve related equipment records from a test record using FetchXML in Dataverse. There is a many-to-many relationship between the test table and the equipment table.
A join (intersect) ...
1
vote
3
answers
122
views
Retrieving data from another table after using MIN function
I have the following query to pull the oldest batch we have shipped today:
SELECT
TO_CHAR(PT.CREATE_DATE_TIME, 'MM/DD/YY'),
PT.ITEM_ID,
MIN(PT.BATCH_NBR)
FROM
PIX_TRAN PT
WHERE
PT.TRAN_TYPE = ...
1
vote
1
answer
90
views
Snowflake JOIN performance Issue
I have a large query that drives a business report - returns about 150k rows but has many steps. I am trying to join to a view that returns about 400k rows.
The view has a material that equals my main ...
0
votes
2
answers
167
views
MariaDB left join ignores index key - slow performance with large joined table
I have a select with a large joined table. On local, performance is fine, but on my server it takes much longer. Below are the version infos (I just upgraded to MariaDB 11.4 on the server).
If I do an ...
0
votes
1
answer
83
views
How do I get my SELECT COUNT() statement to count and return the result rows that have no values? [duplicate]
I have a SELECT statement utilizing JOIN to combine two tables in MySQL. The query I'm attempting to complete is to combine the two tables, INSTRUCTOR and SECTION, and count the number of sections ...
0
votes
0
answers
75
views
Ways to support joins on elasticsearch
I'm working with two Elasticsearch indexes -> accounts and contacts. These indexes are related in such a way that each account can be associated to contacts. However, not all contact data is ...
0
votes
1
answer
43
views
Why does metaprogramming fail to generate valid join SQL while direct query works?
I've been learning about metaprogramming in DolphinDB recently, and I want to use metaprogramming to generate asof join statement.
But I couldn't find any examples of using metaprogramming to generate ...
-1
votes
2
answers
79
views
SQL code for identifying salary for a status
I have 2 tables:
DEPT:
dept_no
C
N
1
200
100
2
300
150
3
400
200
and EMP:
dept_no
employee_no
Task_status
Salary
1
1
C
1
2
N
2
1
C
2
2
C
with column Salary has to be calculated. Task status is C is ...
1
vote
2
answers
95
views
How to join SQL tables with multiple joins with cross-table criteria?
Consider the following Tables
Table A
ID
etc.
1
...
2
...
Table B
A_ID
NAME
etc.
1
A
...
1
B
...
Table C
A_ID
NAME
etc.
1
A
...
1
C
...
Where etc. denotes some unrelated columns that need to be ...
2
votes
3
answers
131
views
join subquery return multiple rows
I have main query:
SELECT mt.media_id, mt.title,
SUM(DISTINCT sht.share) as share_count
FROM $grouped_media_table mt
LEFT JOIN $share_table sht ON sht.media_id = mt.media_id AND sht.title = mt....
0
votes
0
answers
40
views
Why does this simple JOIN query perform poorly in OceanBase
Environment
OceanBase Community Edition 4.2.1 - MySQL mode,3 Availability Zones
I'm evaluating OceanBase for a project that requires complex joins. A query that executes in 200ms on MySQL 5.7 takes ...
1
vote
1
answer
68
views
Create new pyspark data frame from two joined data frames
I want to save the result of two joined dataframes in pyspak in a third, new dataframe.
When I assigned the joined dfs to a variable, its class is NoneType, and what I need is a dataframe.
mappedhh = ...
0
votes
2
answers
67
views
Pandas multi-column multi-assignment merge / update
I want to update the base pandas DataFrame with data from the update DataFrame. This applies to multiple rows of the base DataFrame (ie the merge features are not unique so can't be used as an index) ...
0
votes
1
answer
60
views
Why does PostgreSQL scan a joined table with a foreign key reference to a primary key when it is not logically part of query? [closed]
I am trying to understand why the behavior queries which logically only involve a primary key from one table perform a scan on a referenced foreign key in a joined table. Logically I see no reason ...
1
vote
2
answers
93
views
SQL join 2 table with date, filtered and grouped by a week number
I have 3 tables in SQL:
Agency, booking and checkin (and rooms)
I need to compute a % of checkin / booking, by week number (of begin), by agency
Here somes tables for example
Agency :
id
name
1
first
...
4
votes
2
answers
102
views
SQL join - transform row into column
I'm trying to execute a SQL query to transform some rows into columns. The problem: I have more rows at the end.
Example: I have only one table in Postgres.
id
account
category
sub_category
jsondata (...
-1
votes
3
answers
172
views
Why doesn’t LEFT JOIN include all records from the original left table?
I'm encountering an issue with a LEFT JOIN in SQL that I can't quite figure out. I expect all records from my categories table to be returned, with NULLs for product columns where there's no matching ...
1
vote
1
answer
62
views
Combine two pandas Dataframes with Timestamp Index
I have two dataframes with timestamp data. It is sensor readouts from different sources.
I want to combine them. The left dataframe (df1) can be quite large as it will be a combination of multiple ...
0
votes
2
answers
74
views
mysql join on 2 tables give the false result
I want only the persons who worked on the movie who has no entry for the movie (tconst) in the table "film_berufe_cross_tbl".
my problem is when the person exists in the table "...
0
votes
3
answers
122
views
Teradata SQL Conditional Join
I'm guessing my question was asked before, but after hours of scouring, either I'm not able to figure out how the answers match my dilemma or it truly hasn't been asked (I'm guessing the former). So, ...
0
votes
1
answer
72
views
Joining two tables while ignoring null values in some columns
I am trying to join two tables on muliple criteria, however the set of criteria would be different for each row.
Then, in addition, I want to get a percentile rank for values from one column from one ...
2
votes
1
answer
37
views
Control Spark Join Hash Partitioning
I have three dataframes A, B, and C.
I need to join dataframes A and B on columns [a, b] and dataframes A and C on columns [a, c].
I would like to force Spark to only hash-partition the three ...
1
vote
1
answer
335
views
How do I keep both columns as the result of a Polars join with left_on and right_on?
How do I keep both columns as the result of a Polars join with left_on and right_on, like in SQL?
df1 = pl.DataFrame({"a": ["x","y","z"], "lk": [1,2,3]...
0
votes
0
answers
19
views
Ambiguous column when joining table using createQuery
In my database all tables have key Id. How should I join tables correctly?
For example, right now I'm trying to join the Users and Companies tables like this:
export class UserService<ServiceParams ...
-1
votes
2
answers
67
views
Multi-column catch-all join with 'ND' wildcard across 4 columns
I'm trying to join a large fact table (~100M rows) to a dimension table (~500K rows) using 4 columns as composite keys. In the dimension table, each of the 4 join columns may contain the value 'ND', ...
1
vote
2
answers
131
views
Join 4 tables and retrieve data
I am trying to fetch data from 4 tables related to article id. 4 tables are articles, authors, article_categories, category.
Example data:
Table - articles
id
content
author_id
1
content is here
3
...