ORA-00907: missing right parenthesis I am trying to run the code and I am keeping getting the right parenthesis error I checked the entire code. Could somebody see why I am failing? Answer As mentioned in comments a case expression evaluates to a value, which you can then use or compare to something else. In a where clause it’s usually
Tag: oracle
Oracle SQL- Stack dates if they match diagonally
The goal is to stack dates if DT and VAR are same, and END_DATE matches the START_DATE of next highest START_DATE In the example, row 2 and 3 are combined because END_DATE of row 2 matches START_DATE of row 3. Original Expected I have tried the query below but the solution won’t work when there is additional rows. Answer This
Extremely Huge time take for executing my following query?
I just make some queries for select data from my server. The query is: But this query almost take one day. Any idea for optimize this query please? Answer You provide close to no information that is required to help with performance problem, so only a general checklist can be provided Check the Query The query does not qualify the
Oracle 12c Json split
This is how I am getting result in Oracle 12c Id Start Date Range End Date Range 1 [ “2019-01-07″,”2019-02-17″,”2019-03-17”] [ “2019-01-14″,”2019-02-21″,”2019-03-21”] And I want it Id Start Date Range End Date Range 1 2019-01-07 2019-01-14 1 2019-02-17 2019-02-21 1 2019-03-17 2019-03-21 Earlier I had asked this question for single-column split and below is the link How to replace special
how to drop multiple functions in Oracle
I want to drop multiple functions from my database at a time in Oracle’s SQL developer. Is anyone has an idea how to create a script for that? Answer Well, the static option to drop the functions (sometimes considered more secure as you can double-check what you are removing) consist of two steps 1 – run the following query 2
Trying to join two tables together to have the unit_price vary based on the day
I have some code drafted but I’m not sure how to finish it, or if it needs more work. It looks like this. Everything looks good, but how do I get the price to be based on the given effective date? The given effective date is 01/01/2021. I was thinking something maybe like this for the where: I’m not sure
Oracle SQL ternary operator or function?
Is there a simple Oracle syntax like a ternary operator or function? These work: If there’s a simpler, shorter syntax I would like to know. Answer You can use a CASE expression with LIKE: or DECODE and INSTR: or just simply use LIKE: INSTR: or REGEXP_LIKE: db<>fiddle here
How to create a stored procedure that will update a table
I am trying to create a stored procedure that will update the project status from ‘D’ to ‘C’. As you can see below I do not know what I am doing. Please do not suggest using a trigger as that does not pertain to the question. These are the errors I get when I run this code block: Errors: PROCEDURE
Why do not display values that I have entered in a database table?
Good evening. I have created a database with ORACLE SQL Developer and am having a small problem. In the RENTING table that I have created something like this: I am trying to enter the following data: cAFM = 10001, vPlateNumber = ‘XKO5434’, OutDate = ’13 / 07/2020 09:30 ‘, InDate = ’18 / 07/2020 08:00’ I type these commands: I
Problem using create view and explain plan
I want to test the efficiency of this query using explain plan for. The query works without the explain plan but when I use it I get this errors: I used explain plan on queries without create view and they worked. I don’t know what is causing the error I have tried changing the parenthesis but I get the same