Skip to content

Tag: sql

SQL join two tables by modifying on columns

I have 3 tables on PostgreSQL: SPENDINGS: STORE: CUSTOMER: I would love to join these tables like this: How can I do that could you help me out please? Answer trim(store.zip_code) is not good for the job because the whitespace is within the zip code text. Use replace(store.zip_code, ‘ ‘, ”) …

Join Only Unique Values From 2 Tables

I’m trying to join two MySQL tables, and return only the unique values between them. eg. I want to get as my result a table that only shows the intersections of rows without any duplicates where I’m joining on table1.column1 = table2.column1: Simple joins and unions and I’m ok, but this one …

Counting unique values within a time window

I have data that looks like (over 100.000 rows): What I would like: Explanation CONTEXT I want to find out how many people (person) are working in the same location (Location) by looking at a time window (timestamp) of max 10 minutes and checking whether a person is really working simultaneously or just takin…

Split Characters in a cell to individual columns [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 5 months ago. Improve this question I have a dataset where a column contains 1 and 0 in a single cell which reference security …

Joining 2 Queries without Common Column Fields in SQL?

My issue is in reference to a similar post: Joining tables without a common column in sql server I have 2 queries, each query references different tables, hence the queries do not have common column fields. I want to join the 2 queries together. Let’s take for example the 2 queries has the following dat…

SQL Query to check not repeated values

I’m new to SQL. I wanted to know, How to check the entries which are not repeated for the other entries. Better I give one example. column1 column2 a 1 a 2 a 3 a 4 b 1 b 2 b 3 b 4 c 1 c 2 c 3 I want output as column1 column2 c 4 because c