Skip to content
Advertisement

Tag: oracle

ORA-00906: missing left parenthesis – LIES?

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

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

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

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

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

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

Advertisement