85 questions
5
votes
4
answers
261
views
Oracle rolling sum deduction
I am trying to solve a problem using analytical functions but I am stuck.
I have a list of coupons that I can use. The usage sequence is in alphabetical order of the coupon name
Coupons
Value
A
100
B
...
-1
votes
1
answer
165
views
"SQL Error [XX000]: ERROR: Numeric column 2 precision and scales cannot be merged" when coding logic in REdhsift
Such code gives me an error of: "SQL Error [XX000]: ERROR: Numeric column 2 precision and scales cannot be merged"
WITH RECURSIVE build (PERIOD_START_DATE,PEQ,PREV_PEQ,repeated_patient, ...
-1
votes
2
answers
63
views
Translate excel formulas into Redshift SQL query
I am looking for help to translate excel formulas into Redshift SQL . With given fixed input values for rows 1 (Month ascending) and 2 (SU - some number) I have to calculate through particular cells ...
0
votes
2
answers
144
views
Does TiDB Serverless support TiFlash for analytical jobs (OLAP) just like TiDB?
In TiDB, I can configure and deploy TiFlash, which can be used for columnar based storage to perform OLAP tasks. In TiDB Serverless, I can see the same columnar storage is available on the dashboard. ...
0
votes
1
answer
64
views
How can I add add subtotals to Oracle Query which uses ratio_to_report?
I am trying to add totals to a moderately simple query which contains RATIO_TO_REPORT. I reviewed the Stack solution (among others) and I was unable to make it work in with my query.
My query is;
...
-1
votes
1
answer
263
views
Teradata: Case statement in analytical function
I've a case where the data needs to be represented based on the events
I need to achieve the following output
Explanation:
ABC is represented thrice here and you can see date being different,
...
0
votes
2
answers
56
views
Query to count and filter records
This is my data:
ACCOUNT
PARTNER
ADDRS_NUM
HL124
2341
ASD123
HL124
2341
SDF234
HL124
234N
SDF234
HG225
45BV
QWE345
HG225
72AA
QWE345
UY150
8846
CCC204
Need to get ACCOUNT that has more than one ...
1
vote
1
answer
569
views
How can i use Descarta2D package for Mathematica?
Recently I download a pdf book named -"Exploring Analytical Geometry with Mathematica ".In this book, they used a package "Descarta2D". I can't understand how can I add these ...
0
votes
1
answer
54
views
Oracle PL/SQL: A SELECT statement replicating the START_DATE of the first record with END_DATE NOT NULL
This is the starting situation:
If END_DATE is NOT NULL, then the previous empty records (= records with NO START_DATE and NO END_DATE) have to be filled with the START_DATE referred to that END_DATE....
1
vote
2
answers
49
views
Oracle SQL: Generating a group id in a result set by country within a time boundary
I have the following result set ordered by ID, REGISTRATION_TS, COUNTRY
ID CO REGISTRATION_TS
----- -- -------------------
56053 CH 05/07/2022 20:57:47
56053 CH 05/07/2022 23:26:05
56053 CH 06/...
0
votes
1
answer
72
views
Row Values To Appear In Separate Columns
I have the following data
create table company (com_cd varchar2(100), act_id number(10));
insert into company values ('IBM',100);
insert into company values ('IBM',200);
insert into company values ('...
0
votes
1
answer
283
views
Circle-Circle Intersection in 3D space
I have 2 circles C1 and C2 which lies on 2 different planes in 3D space. I want to intersect those circles and find the intersection points.
Inputs :
C1(x,y,z), Radius R1 and Plane P1
C2(x,y,z), ...
0
votes
1
answer
178
views
Error while using Window Clause in Oracle Query
I have been looking at this code for the past two days now and I can not seem to get it to work.
It does work without the Window clause though.
It keeps giving me:
ORA-00907: missing right parenthesis....
0
votes
2
answers
74
views
Counting id for both days SQL
Can anyone help me, please?
The task is to find the number of rides taken by drivers who took a ride on both days
create table rides
(
ride_id int,
driver_id int,
ride_in_kms int,
...
0
votes
2
answers
168
views
Is it possible to find out the number of items in a row by using window functions in PostgreSQL?
how to find the number of sellers who have payments, the time between which in a row is less than 1 minute and which are executed at least 3 times in a row? (answer is 2 sellers)
and how to calculate ...