All Questions
20,012
questions
0
votes
1
answer
27
views
Deduplication based on other dataframe columns
I have pyspark df1 as
+----+
|name|
+----+
| A|
| B|
| C|
| D|
+----+
and df2 as
+------+------+
|name_a|name_b|
+------+------+
| A| B|
| B| A|
| C| A|
| A| C|...
-1
votes
1
answer
58
views
SQL JOIN to the same table explanation
I am refactoring some code that was written by another person that is no longer around. In this query a MAX(Date) is being selected, but then joined to they same table via MAX(Locator). The locator is ...
-1
votes
2
answers
31
views
Postgres Query to join multiple tables properly
I want to join two tables to get the output as shown in Table4. Below are the details:
Table1: SalesData
Date
PlatformId
UnitsSold
Revenue
ChannelId
2024-07-01
ABCD1
12
1200
1
2024-07-02
ABCD1
11
...
-1
votes
0
answers
36
views
Postgres left joins showing duplicate rows from sub tables [closed]
I have three tables:
Base table:
parent_id
parent_name
location
P1
Mr. Smith
New York
Child table:
s_id
child_name
parent_id
C1
Jane
P1
C2
John
P1
School table:
school_id
school_name
parent_id
...
0
votes
3
answers
52
views
How to return multiple columns based on lowest score in table a, and join to flag eligibility in table b
I am wanting to return for each customer, the column names for the lowest 2 scoring products from Table A but only where the customer is eligible for that product which is indicated in Table B by a 1 ...
0
votes
1
answer
21
views
"no such table" error when attempting a join function with two different tables in sqflite
I'm having quite a few problems understanding how sqflite works.
I have the following "users" and "items" tables and their create method:
//tableName = "items"
Future<...
-1
votes
0
answers
18
views
OTBI Data Model Dataset Join [closed]
I am newly introduced to OTBI due to work (about 2 months ago). I have some SQL knowledge, but I am at a loss on how to join to datasets I have.
I want to list my budget and expenses (see screenshot) ...
1
vote
0
answers
26
views
Grails Lazy load to avoid Too many table issue after 61 tables to Join
I have a set of tables inherited from the parent table and finally got stuck with the SQL limitation of joining too many tables.
Too many tables; MySQL can only use 61 tables in a join. Stacktrace ...
1
vote
1
answer
57
views
Joining together 2 tables while joining one table twice with different filters
I have collected data in 2 SQL Server tables:
AREAS
area
a
b
SHIFTS
personal_id
date
shifttime
area
12
2012-01-10
early
a
13
2012-01-10
early
a
14
2012-01-10
late
a
15
2012-01-10
early
b
I ...
0
votes
0
answers
38
views
How to make aggregate function value a permanent column value?
I have the following query which gives the current_rating value which I am after. However I am wondering how I then make this query update my table permanently so the current_rating value column ...
2
votes
1
answer
38
views
NVL join using pandas
I want to perform a NVL join with pandas, e.g. in SQL:
select * from TA
join TB on
TA.column = NVL(TB.column, TA.column)
Here is a complete example in SQL, showing what would be expected:
/* first ...
-1
votes
2
answers
88
views
SQL: Batch replacing integer values in a query with their textual values
I have several columns in table BASE that have values of 1, 2, and 3.
Instead of a query returning with these boolean/integer values, I'd like the query to return with No, Yes, and N/A, respectively.
...
0
votes
0
answers
37
views
Inner Join using Like Operator in Big Query
I have a list of c.11k strings that I need to partially match to string IDs within a BigQ table.
T1 is the original BQ table and T2 is a table with a column of the 11,000 strings
At the minute I have ...
-2
votes
2
answers
44
views
Handling Null Values For Unmatched Rows in a Left Join SQL
Sorry for the horrible first part of the question. Tried to explain with example in second part.
I have two tables a, b. I am left joining these two tables based on three columns to retrieve a column '...
0
votes
1
answer
22
views
should these expressions yield the same result? u.creation_date < '2019-02-01' vs. u.creation_date <= '2019-01-31'
I am doing SQL exercise at Kaggle (Exercise: JOINs and UNIONs, 3) Initial questions and answers, Part 2) working with stackoverflow database.
For some reason, the query with
u.creation_date <= '...