I have stared at this until my eyeballs bleed, where am I missing a parenthesis? It does also say Error starting at line: 1 in command-“. The cause and action section of the error report is blank. Answer This just because you missed column name while declaring primary key. There is another problem: constraint name for both fourth and fifth
Tag: oracle
Compare the triplet rows together and select max of them?
Consider the following time series data These are the values of y, and the x column starts from 1 respectively. I have come to the conclusion that if the data in the y-column are compared three by three, the maximum value in each triad, is the peak point. Does anyone have an idea how to specify peak points without using
I am trying to return Col1 as a value for a list, IF Col2 = NULL
I am trying to return all Col1 values IF the respective Col2 value = NULL I have thought of IF Col2 = NULL Return Col2 END IF, But I am unsure of how to format this, because when I run it I get errors saying invalid relational operator. Thank you for your time. SELECT Col1 FROM mytable WHERE IF NULL
Oracle partitioning by range
I need to split the table into partitions, namely into three partitions according to the EVENT_TIME field, where the first partition is an interval of a week from today, the second last week and the third partition is history, where data that does not pass into the first two partitions are placed. In addition, I need to add a trigger
How to analyze metadata of given schema name and table name dynamically in Oracle?
I am trying to write a dynamic oracle plsql script that takes schema_name and table_name for parameter and returns Primaty Key Column names,Index flag(if table contains index returns 1 else 0),data volume for size of table in db,row count and column count of selected schema and table.Here is my code It gives me these errors : How can i fix
Oracle SQL – count number of active/open tickets per hour by day
I have a dataset from oracle db that looks something like this: I need to calculate the number of active tickets in an hour time slot. So if the ticket was opened before that hour, and closed after the hour it would be counted. All days and hours need to be represented regardless if there are active tickets open during
Accpt employee number from user fetch the employee details from the “Employee” table and store it to a PLSQL record type variable and print the same
Accpt employee number from user fetch the employee details from the “Employee” table and store it to a PLSQL record type variable and print the same. Answer Here’s one option (if that’s what you’re looking for):
rank with the sum
Below is the table: where I want to rank the category based on weightage desc, expected results: what was already tried: select desnse_rank() over (partition by category order by weightage desc), but I need to rank it based on sum(weightage) per category. Answer With a CTE you can do the calculations one by one. First calculate the dense rank for
How to find all records that are older than or equal to the current month of the previous year?
I barely know SQL. I am trying to achieve the following: For example I have the following table that has 2 fields I need to find all whose birthdays are current month of the previous year and prior. For example if I am running the query on 08/15/2021, I need to find all records that have a month/date of 08/2020
ORACLE DATETIME ROUND UP WHEN MINUTES 0
I have a datetime: I need to round up just when the minutes are different to 00. Example: 1/1/2000 2:37:00 AM => should be => 1/1/2000 3:00:00 AM. (dont round up if hour =00) 1/1/2000 2:00:00 AM => should be => 1/1/2000 2:00:00 AM For now my code has round function but this one look the nearest hour, I need