673,946 questions
-2
votes
2
answers
68
views
SQL COUNT function [closed]
I've been learning about COUNT function in SQL. They give me an example but I don't really understand what the COUNT syntax means. Can someone please explain it specifically? This is the code
SELECT
...
0
votes
0
answers
42
views
Using a SELECT alias inside HAVING
I'm using Apache IoTDB 2.0.8 in table model. I need to filter grouped aggregate results, so I tried to define AVG(voltage) once with the alias avg_v and reuse that alias in HAVING.
Schema and original ...
6
votes
1
answer
129
views
Grouping text rows in equal-sized groups
I have a table containing a lot of typed/named items and I want to create a (materialized?) view to group them together so that a UI can later make it easier for users to select.
Description
The goal ...
-3
votes
0
answers
76
views
Stored procedure testing query [closed]
We are testing a stored procedure that performs insert, update, and delete operations between a source table and a target table, each containing 100+ columns.
As part of our test cases, we are ...
0
votes
1
answer
123
views
JOINING three tables using subquery with MAX date [duplicate]
I have three tables, orders, invoices and invoice lines.
uid OrderNumber product_id product_name quantityOnOrder
1 101 p001 Apple 6
2 102 p002 ...
Best practices
0
votes
7
replies
163
views
SQL query for adding two numbers
I am trying to write a basic SQL query that adds two numbers together. While the core arithmetic is straightforward, I want to make sure I am using the standard approach that works across different ...
3
votes
4
answers
159
views
SQL Sum Aggregation
Data Set
animal
legs
parrot
2
chicken
2
dog
4
cat
4
c'thulu
999
missing'no
0
Goal
animal
legs
bird
4
mammal
8
I'm not sure what's wrong with my Oracle SQL query. It doesn't seem to be aggregating ...
-1
votes
0
answers
84
views
In SQLite with DBeaver Transaction....Commit is not working
I am using SQLite with DBeaver. I recently got a university assignment where I was asked to show the locking mechanism of a database. So I decided to work with DBeaver.
I can solve it properly with ...
1
vote
2
answers
135
views
Use GROUP_CONCAT as a condition
I'm creating a query where I have a box, and it has multiple products. I want to check whether any of the products' product_numbers can be found on the addons table. So I initially made this query:
...
0
votes
0
answers
179
views
Is a fast-return possible when parameter value not provided [migrated]
I've got a query looking for accounts against the user-provided input:
SELECT * FROM accounts a
WHERE a.dep_id in :depIds
AND (
(a.key_identifier IS NULL AND a.name LIKE CONCAT(:searchText, '%...
Advice
1
vote
3
replies
155
views
How should I structure a beginner WPF Bicycle (class) app with multiple windows and MySQL integration?
I am currently learning WPF (C#) and trying to build a small Bicycle Management application for practice. I understand the basics individually (WPF controls, simple classes, MySQL connections, etc.), ...
1
vote
2
answers
151
views
Multiple delimited strings insert in nested while loop [duplicate]
I'm using SQL Server 2014 so no split string function is available.
I have two delimited strings (Brand and Location) to insert in my stored procedure to create (potentially) multiple rows in the ...
1
vote
2
answers
145
views
how to calculate concurrent call by cdr
I have two tables
table testlist20230519_20
cdrid
starttime
endtime
641EA5F600041BC4
1684425611.337
1684425619.687
641EA5F600041BC5
1684425612
1684425618
641EA5F600041BC6
1684425610.082
1684425617.436
...
Best practices
0
votes
2
replies
120
views
Error when replacing 0 values with NULL for weather data analysis
As a data analyst using Google BigQuery to analyze 2023 weather data for a local news station. You're trying to study the relationship between wind, speed and visibility, but the dataset has missing ...
Advice
1
vote
2
replies
96
views
Join two tables to get partitioned sum of last 90 days
I have two tables; let's call them table_a and table_b. They look like this:
Table_a:
id | date
---|-----------
A | 2026-05-17
A | 2026-05-01
A | 2026-04-10
B | 2026-05-17
Table_b:
id | date ...
