674,428 questions
-4
votes
0
answers
65
views
Creating a median function in SQL [closed]
I have a table:
CREATE TABLE items
(
item_date DATE,
item VARCHAR(50),
price DECIMAL(10,2)
);
INSERT INTO items (item_date, item, price) VALUES ('2020-01-01', 'APPLE', 1.50);
INSERT INTO ...
1
vote
1
answer
91
views
SQL fails when adding ORDER BY clause
In Access 2016, I have 3 related tables:
Series
tblSeasons
tblEpisodes
Trying to write SQL to get a list of Series with a number of conditions.
I have found that the following works perfectly fine.
...
-1
votes
3
answers
114
views
How to empty a single column in MySQL without updating each row individually? [closed]
I have a large MySQL table in phpMyAdmin, and I want to clear all data in a specific column.
I know how to do it using:
UPDATE table_name SET column_name = NULL;
Or by dropping and re-adding the ...
Advice
0
votes
2
replies
24
views
Parallelized Access to TypedTuplestore data structure in PostgreSQL
I am working on a C-UDF for Postgres, where i would like to somehow read from a passed Typed-Tuplestore in parallel. Either pthreads or worker-processes is fine, as long as the access isn't combined ...
-2
votes
2
answers
110
views
Lookup multiples values from another table [closed]
I have 2 tables
Table1:
ID
rule_id_1
rule_id_2
1
12345
67889
2
54321
12345
Table2:
rule_id
rule_name
12345
Error Detected
54321
Job Completed
Goal is to have a table like this:
ID
rule_id_1
...
0
votes
0
answers
38
views
Unexpected Floating-Point Precision Error with SUM Aggregation Function in Apache IoTDB? [duplicate]
While using the aggregation functions in Apache IoTDB (version 2.0.5, tree model), I noticed that the result of the SUM function does not match the expected value, showing a noticeable floating-point ...
1
vote
0
answers
88
views
How optimize SQL query with location search in large radius
I have next PostrgreSQL query:
SELECT *
FROM person
WHERE birth_date between ? and ?
and gender = ?
and ST_DWithin(location, ST_MakePoint(?, ?), 20000)
and activity_date <= ?
and id < ?
...
0
votes
1
answer
83
views
CASE Expression in JOIN [duplicate]
I am having some trouble with a CASE expression inside a JOIN.
Essentially, what I would like to do, is whenever a FormLookupId = 31 I want to join on any record with the a specific string in the rl....
1
vote
2
answers
66
views
insert multiple records for multiple tables in a single query
I've got this situation in which I need to copy and split account information:
-- old
create table old_account (
id bigserial not null primary key,
uid varchar(32) -- , etc.
);
insert into ...
-4
votes
0
answers
49
views
JSON explosion and correct grain comparison [closed]
I need to flatten the JSON below in a way that will follow the logic:
1 actions can be repeated
1 personId repeated
however per 1 personId will go unique feeType or correspondenceValue.
also, ...
-3
votes
1
answer
94
views
Group Transaction in To/From columns [closed]
I have this table here as example:
Group
Where
Bill
Amount
A
from
telephone
-300
A
from
internet
-200
A
to
electricity
500
B
from
water
-1000
B
to
cable
500
B
to
gas
500
When you query Group A. The ...
Tooling
0
votes
6
replies
83
views
SQL vs R : when to use which?
I am in the process of becoming a data analyst and I am having a hard time understanding when to use SQL and when to use R. I have tried re-watching videos of my data analyst course, but I am still ...
1
vote
1
answer
91
views
Oracle: Character Set Mismatch
can you tell me why i get Character Set Mismatch in the first insert even if "in theory" they are equivalent?
Oracle version: 19
SD.ValueText is NVARCHAR2
SELECT value FROM ...
-6
votes
0
answers
77
views
Merge execution failure [closed]
CREATE TABLE IF NOT EXISTS abcatedt (
abe_name char(30) NOT NULL
, abe_edit char(254)
, abe_type smallint
, abe_cntr integer
, abe_seqn smallint NOT NULL
, abe_flag integer
...
-3
votes
1
answer
66
views
Find Member COE based on service dates [closed]
I have a table with a list of claims for members that have specific service date ranges. The other table has a table of COE descriptions. The COE changes for some members and is indicated by the ...