Questions tagged [analytical]
82 questions
2
votes
4 answers
Need algorithm for Sequence calculation
I am trying to find the solution for a problem where i have something like
A > B
B > C
B > D
C > D
And I should get the answer as A > B > C > D.
Conditions for this problem
The output will involve all the elements.
The problem will not have any…

bragboy
- 34,892
- 30
- 114
- 171
2
votes
1 answer
SQL Windowing functions: does the order of appearance for columns matter in partition by?
I'm trying to better understand the analytical functions in SQL.
Is my understanding correct that the windowing function will be applied to every unique combination of fields that appear in "partition by"?
If I were to partition my result-set by…

x.farhad
- 23
- 3
1
vote
1 answer
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 packages in my Mathematica.
I look at many websites to solve this problem…

tasneem alam
- 11
- 2
1
vote
2 answers
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/07/2022 03:40:18
56053 CH 06/07/2022…

Tony Perez
- 43
- 5
1
vote
1 answer
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 ('IBM',300);
insert into company values…

Sam
- 15
- 4
1
vote
2 answers
Rank function with complex scenario
I have a TAble TABLE1 and having columns like ID, Status and Code
BAsed on the code priority i want the output , the priority is
SS -> RR - > TT - > AA ( these priority is not stored in any tables)
Query should first look for Approved status then…

Ram
- 59
- 1
- 6
1
vote
2 answers
Oracle Analytical Function?
For the given table below, how can we find the customer whose name appears 3 times consecutively.
+---------+-----------+
| CUST_ID | CUST_NAME |
+---------+-----------+
| 1 | SAM |
+---------+-----------+
| 2 | SAM …

Novice_Techie
- 426
- 3
- 10
- 21
1
vote
2 answers
sorting data in oracle
I have a tricky scenario.
Data in the table is as follows
CustomerId Transaction Type Transaction Amount
1 Payment 100
1 payment 200
1 ReversePayment -100
1 …

Nazeer Syed
- 27
- 4
1
vote
1 answer
deriving equations for point clouds in sympy or alternatives
Assume you have a point cloud (stored in R, 3xN dimensional matrix) in a 3D orthogonal coordinate system,
and you would like to derive analytical expressions for complicated functions of R (including differentiation, summations, etc.
As a simple…

user2393987
- 189
- 1
- 2
- 9
1
vote
2 answers
Cube Js | calculate difference between 2 Dates
In cube js finding the count between days is not working for mysql database. Please help me to resolve. While calculating the balance days between....
measures: {
balanceDays:
{
type: count,
sql: DATEDIFF(day,…

ramprakash jagadeesan
- 218
- 2
- 15
1
vote
1 answer
SQL Find a minimum number for each value in analytical function
I am using Microsoft SQL Server. I want to write a query with only analytical function ( like not using group by)
I want to write a query that returns rows of:
MIN(Customer_number), count(code), private
MIN(Customer_number), count(code),…

John
- 11
- 2
1
vote
1 answer
SQL: Rolling Count over a Time Range
I need to find number of active Customers within last 3 months over a loop.
So I go into my Transaction table, and find out the Customers who bought something over a range of 3 months. But I want to achieve it using analytical function.
select…

tranceporter
- 189
- 1
- 15
1
vote
1 answer
Impala Analytical functions in where clause
So the basic premise of the question is that I have some huge tables in hadoop that I need to get some samples from each month. I've mocked up the below to show the sort of thing I'm after but obviously it's not real data...
--Create the…

Tim Edwards
- 1,031
- 1
- 13
- 34
1
vote
1 answer
Using analytical Count(distinct) on Vertica is not supported
Having a thorough Google research, it seems that Vertica DB simply does not support count(distinct ) over(), as it causes:
"ERROR 4249: Only MIN/MAX are allowed to use DISTINCT ... MIN/MAX are allowed to use DISTINCT"
I'm…

goidelg
- 316
- 2
- 16
1
vote
2 answers
Preventing running total from going negative in Oracle
Column 'amount' has value 5 in first row, and value -10 in second row.
Is there a way to make oracle's sum(amount) over() function to return 0 instead of -5 for the second row?

Marko
- 803
- 9
- 13