674,312 questions
0
votes
0
answers
84
views
Why does SQL Server 2022 treat formatting time different than datetime? [closed]
I'm working on a project for work, where initially I was going to store a time in a datetimeoffset field in a table. I only care about the time and not the date, so I was going to use a placeholder ...
0
votes
3
answers
77
views
How to return row where items are grouped by Id and related reference fields?
Suppose I have this table and values:
DECLARE @TEST AS TABLE
(
GroupId INT NOT NULL,
ItemId INT NOT NULL,
Ref1 NVARCHAR(10) NULL,
Ref2 NVARCHAR(10) NULL
)
INSERT INTO @TEST
VALUES
(1, ...
-4
votes
0
answers
48
views
SQL insert--select statement is not applying data to correct columns [duplicate]
I am making a weekly rota. I have managed to duplicate a SQL database row in a table using this code below and used a CASE expression to apply the modified data to the duplicated rows.
The problem I ...
-1
votes
0
answers
92
views
Select distinct returns duplicates - no join, one column [closed]
I'm trying to insert distinct values from one table column into another with this:
insert into animals
select distinct trim(s.value)
from all_animals t
cross apply string_split(speciesname, ',') s;
...
Advice
1
vote
11
replies
81
views
AWS hosted server and data to Excel
Our company moved a server to the AWS cloud not too long ago.
We use some software the stores info into a SQL database.
Normally before the cloud we are trained to use Excel to connect to one the ...
Best practices
2
votes
2
replies
95
views
Text search versus regular expressions
I'm doing text search with user entered queries against multiple sources documents.
The user can enter 16 MB or 16MB and the document can contain one or the other. I could not make it with pure text ...
-4
votes
0
answers
73
views
LEFT JOIN returns expected result but INNER JOIN or adding WHERE IS NOT NULL returns no rows [duplicate]
On the first run of this Oracle 11g SQL query I unexpectedly get no result.
When I run a second time, the DBMS re-evaluates the execution plan and I get the expected result.
In a test if this query is ...
-1
votes
1
answer
78
views
Apply a SQL Case condition to a SQL duplicated row in the same statement
I am making weekly rota. I have managed to duplicate a SQL database row in a table using this code:
$test = "2026-03-02";
$sql = "INSERT INTO myrota (weekstart, shift, employid, name, ...
3
votes
1
answer
111
views
Add unaccent to text search
I want to add the unaccent extension in the text search.
Configuration:
create extension if not exists unaccent;
drop text search configuration if exists portugues_sem_acento;
create text search ...
1
vote
1
answer
88
views
Combine multiple records into one
I have the following db2 table with data that looks like this:
KID_ID
F_NAME
L_NAME
TOY_NAME
HAS_IT
1
ABC
DEF
CAR
NO
1
ABC
DEF
BALL
NO
2
HIJ
LMN
CAR
YES
2
HIJ
LMN
BALL
NO
3
XYZ
123
CAR
NO
3
XYZ
123
...
1
vote
2
answers
87
views
SQLite doesn't see all columns of my table [closed]
self.cur.execute("DROP TABLE IF EXISTS analysisResults")
self.cur.execute("""CREATE TABLE IF NOT EXISTS analysisResults(
subjectID INTEGER
...
-2
votes
1
answer
37
views
How to Perform Conditional Statistics with `Time` Grouping in Apache IoTDB Table Model? [closed]
I want to group data by time intervals and then count the number of records that meet specific conditions within the Table Model of Apache IoTDB 2.0.6. However, my query execution failed. Below are ...
0
votes
4
answers
123
views
Query to select a value of a column of a table identified by a value of another table
I'm wondering if it is possible to use an Access SQL query that selects a value of a column of a table identified by a value of another table.
For example I have tables A, B, C and D:
A:
ID_A
tbl
...
Advice
0
votes
8
replies
106
views
Differences between SQL dialects?
I have heard of SQLite, MySQL and other dialects of SQL.
How do they differ?
Where do you use which one?
Which ones are the most used?
What is the purpose of this?
-3
votes
0
answers
91
views
Receiving Error: Msg 1011, Level 16, State 1, Line 40 The correlation name 'PS' is specified multiple times in a FROM clause [closed]
Need help understanding the title error, received in connection with the subquery below. For a little context, the REFTABLE used in the last two joins is (in my view) a poorly thought out table where ...