I am trying to find the maximum value of something, while also selecting other attributes at the same time. When i do the max statement on its own, it works as intended, but when I select another …
Tag: oracle
Select longest duration time (data type field) and client name SQL
I have these tables: CREATE TABLE Client ( client_id NUMBER(10) NOT NULL PRIMARY KEY, name VARCHAR(50) NOT NULL, address VARCHAR(50) NOT NULL ); CREATE TABLE Projects ( project_id …
Trigger is not called on update table in oracle
I’m trying to make a trigger that updates the ID_ABONAMENT from the CONTRACTE table, when the ABONATI table is updated. The problem is that the trigger is not called when I update a row in the ABONATI …
Finding the length of years between todays date and a column of dates
I’m new to sql so it might not be too difficult for some of you but I simply need to find the length in years between a column displaying different dates and todays date. I’m not too sure what i’m …
How to select an element just once in plain SQL
I’ve seen other similar questions to mine, but I haven’t found one that could actually help me. I have a table, defined like so: CREATE TABLE “DOWNLOAD_HISTORY” ( “ID” …
How to filter json in PLSQL?
My data look like: CLUID EVENT_PAYLOAD STEP 1998-06-22-23.58.16.792243 {“type”:”page”,”name&…
Oracle optimize select after update status performance
I have a store procedure that will Update maximum 500 rows status from 0 to 1 Return those rows to program via cursor Here is my store procedure code PROCEDURE process_data_out ( o_rt_cursor …
Check for overlapped dates on any row of a table Oracle SQL
I have the following schema: CREATE TABLE EPOCA ( ID INT CONSTRAINT PK_EPOCA PRIMARY KEY, NOME VARCHAR(250), DATA_INI DATE CONSTRAINT NN_EPOCA_DATA_INI NOT NULL, …
Query Optimization – To repeat a pattern in Oracle SQL
Introduction: I can do this in MS-Excel, it takes me 1 minute, but I m trying to get this in Oracle SQL Here is my Code: SELECT A.*, (CASE WHEN A.r = 1 then ‘X1’ when A.r = 2 then ‘X2’ when A.r = 3 …
please find the solution of this problem. ( in PL SQL ) ——–
I’m doing an assignment and the last question states that I call the procedure from question 2 and function from question 3 and then put them in an insert clause(question 4). Write a PL/SQL Code for an anonymous block to do the following (in package): a) Get the doctor name for a given doctor id (read f…