674,286 questions
-1
votes
0
answers
53
views
Compare the sum of two different values group by another column (distinct), and group by of "opposite" value
I'm trying to write a query to find "matching" data from two different fields within the same table.
For example, a table has a client column, amount charged column and location column. I ...
Advice
1
vote
11
replies
63
views
How should I share, save and combine JavaScript variables across HTML sites?
I am passionate about writing a personality/psychology/dating website. I know how to use variables a bit, but I don't know which is the best way to store them. There are cookies, sessionstorage and ...
Advice
0
votes
6
replies
70
views
SQL INSERT OUTPUT to another table
I have a task required where we are pulling in data originally from another data source and we have the data imported to SQL Server as a flat table called MigratedCustomer. We need to insert the data ...
0
votes
2
answers
81
views
Getting rows when it has multiple rows or only one row in another table based on a column value
I have 2 tables Family:
family_Name | family_id
and Types:
family_fk | type
Request #1: I want to get all family_ids when it has only one type = 'multiple'
Request #2: I want to get all family_ids ...
-5
votes
0
answers
85
views
SQL incorrect output [closed]
I have this data that shows state, number of fatalities in accident, and state population.
enter image description here
What is wrong with this line of SQL, the output is wrong.
enter image ...
-2
votes
0
answers
164
views
Query returning unexpected results when filtering rows in GridDB? [closed]
I am trying to understand why my query is not working correctly.
I am currently experimenting with SQL queries while working with GridDB. I am trying to retrieve specific data from a table, but my ...
Best practices
0
votes
10
replies
69
views
SCD Type 2 implementation using MERGE
I have implemented MERGE statement to capture INSERT and UPDATE records from staging table to Target table. My ask is when I tried to insert already existing records in staging table its simply ...
Best practices
1
vote
3
replies
73
views
Difference between CONCAT with II and CONCAT with +
What is the difference between CONCAT with II and CONCAT with + in SQL?
Which should be used and when?.
If possible can anyone please explain with example.
Advice
0
votes
4
replies
74
views
Simplifying SQL statement to make it more compact
I am coding some SQL and I needed to return all the countries from the world database where the country name contains "united". The following was my solution:
SELECT name
FROM world
WHERE ...
-1
votes
0
answers
97
views
Efficient way to calculate rolling time-window aggregations in GridDB time-series data? [closed]
I am experimenting with GridDB for an IoT analytics application where sensors continuously send temperature and humidity readings.
Each record contains a timestamp and the measurements. The container ...
2
votes
2
answers
97
views
Obtain list of all attendees with their reg_code in a column headed by year-attended from multiple tables containing multiple years of attendees
So I have 5 years of registration data for show attendees... I want a list of everyone who's ever attended in those 5 years, with their reg-code in a column with the year-attended at the top.
So the ...
-4
votes
1
answer
102
views
How do I show all dates in a period? [closed]
I try to create a list of technical intervention means for a given period. The table:
Date
Technician
Task
03.03.2026
MA
Replace censor 25b
05.03.2026
FM
Adjust Dielectric level
06.03.2026
MA
Empty ...
0
votes
0
answers
113
views
Combine multiple rows into a single row for a Join with a one-to-many relationship [duplicate]
I have three tables Item, Sales Price, and Item Category.
Item has columns: Id, Name, Description
Sample data:
1 | Test Name | Test Description
2 | Other Name | Other Description
3 | ...
0
votes
1
answer
90
views
How to not get Invalid Date after inserting into snowflake DB
I have a pandas dataframe named "df". The dataframe has two columns (CREATEDDATE and LASTMODIFIEDDATE) which contain datetime values. When i try to insert using this df into snowflake db,the ...
3
votes
2
answers
95
views
Advantages of DISTINCT checks when updating columns in PostgreSQL?
In PostgreSQL, is there any advantage in writing update statements like this
update
person
set
name = :newName
where
name = :oldName AND
name IS DISTINCT FROM :newName
over simply
update
...