I have a table in Oracle: select * from leave; –LEAVE_DTL_ID is auto incremented LEAVE_DTL_ID STAFF_ID START_DT END_DT ———— ———- ——— -…
Tag: oracle
how to get data from different levels in a xmltable?
I’m trying to get the values of two attributes from table MVR_DTL in column VENDOR_XML. VENDOR_XML is of datatype clob and contains an xml that looks like this <Routing …
Update Oracle table column with a sequence number based on varchar field in same table
I am in need of help with the syntax to update an existing field in an oracle table with a new number sequence based on the ordering of another field that is VARCHAR2. Current Table: CODE …
Putting a sql table into python error. Whats wrong?
I would like to know what’s going on with this query. Im not able of put it into a pandas data frame. The error description is “IndexError: tuple index out of range” i = 3 query = (“SELECT COL1, …
how to get different date ranges for the last One year as per sysdate
I have a scenario: as per my sysdate i need to capture last 12 months dates. Example: I will be getting a parameter which is numeric like : 2,3,4,6 .. If the parameter is 3: then as per sysdate-12 …
Group rows in Oracle using PARTITION BY
I have below 2 tables which i want to display like shown result Data Table 1 id col1 col2 t1 data1 data2 t2 data3 data4 Data Table 2 idOfTable1 col3 col4 t1 …
Gaps and Islands Months only
I am working with a data set of clients and their date records. I am trying to apply a gaps and island problem only using MONTHS,( currently var char ‘YYYYMM’). I need to take individual records and …
SQL query to get child count and sum it
My table is kind of like : ID CODE SUB_CODE —— —— ———— | 1 | A | A1 | ————————– | 2 | A | A1 | ————————– …
Is there a difference between Oracle SQL ‘KEEP’ for multiple columns and ‘KEEP’ for one and GROUP BY for the rest?
I’m just now learning about KEEP in Oracle SQL, but I cannot seem to find documentation that explains why their examples use KEEP in all columns that are not indexed. I have a table with 5 columns …
How to calculate the percentage of salary paid by each account for each employee?
I need to find the percentage of an employee’s salary that is paid by each account. For example.. I need to find a way to sum the amounts of each employee and then divide each amount by that total. …