I’m trying to create an excel-like pivot table with 3 columns of information, order tpye, product code, and the income generated from that order. I’ve managed to get the generated income for every …
Tag: oracle
How to aggregate count of rows having the same value in a sequence?
I have a query that returns data in the following sample: SELECT timestamp, atm_id FROM TRANSACTIONS ORDER BY TIMESTAMP ASC; Output TIMESTAMP | ATM_ID | ——————– 2010-01-01 | EP02 | …
SQL query to convert no. of rows to no. of column in oracle
I need to convert all rows into columns i.e. no.of columns= total no. of values in col2 and col3 related to col1. Scenario Query tried: How can I write a pivot query here? Answer use row_number() and conditional aggregation
count(distinct) over (partition by… doesn’t work in Oracle SQL
I want to count the distinct day_number over the past 30 days. However, the distinct function can’t be used with over If I delete distinct, it will give me the total count of the day_number, but …
Oracle – Convert datetime format
I have a temp table. It has last_update column in 2/10/2018 6:01:50 PM datetime format. How can I write THE BEST QUERY to display all information that’s updated on 02-Oct-2018 day?
Is there any other way to extract the number of exam?
Hello everyone I have a problem that I need help with I’m trying to get number of exam for specified student we have three tables : etudient (N_Appoge,Nom,PRENOM,filiere,….) module (NUM_Module,…
Query Hierarchical Queries
I wanted to profile my data set to find the data discrepancies. My sample date set: id status stdate enddate 1 new 01-JUL-17 31-JUL-17 1 process 01-OCT-17 31-DEC-…
How can I use rank function to solve this?
I have this data: and I want to this result: So I ve tried this: but it did not solve my problem. How can I solve this issue? thanks in advance Answer DENSE_RANK not RANK:
Oracle SQL: select count of multiple distinct fields
I need to select id, type and count of rows with unique id-type combinations. So I tried something like this: SELECT ID, CASE WHEN /**/ THEN ‘FIRST’ WHEN /**/ THEN ‘ANOTHER’ …
get the values mit highets value sql
the following table is given (in Oracle); LVL KID FATHER 1 POD001 DPR001 1 POD002 DPR002 1 POD003 POD002 2 POD003 DPR002 2 POD004 DPR001 1 POD004 POD001 2 POD005 POD002 …