Skip to content
Advertisement

Tag: oracle

Split row data base on timestamp SQL Oracle

Good day everyone. I have a table as below. Duration is the time from current state to next state. Timestamp State Duration(minutes) 10/9/2022 8:50:00 AM A 35 10/9/2022 9:25:00 AM B 10 10/9/2022 9:35:00 AM C … How do I split data at 9:00 AM of each day like below: Timestamp State Duration(minutes) 10/9/2022 8:50:00 AM A 10 10/9/2022 9:00:00

Can a CLOB column containing objects be sorted?

I have a column type CLOB that stores an array of objects containing the following structure: {“id”: number, “name”: string} Then suppose we have the following column of CLOB records: [{“id”: 21, “nombre”: “fisica”}, {“id”: 16, “nombre”: “auditiva”}] [{“id”: 16, “nombre”: “auditiva”}] [{“id”: 4, “nombre”: “intelectual”}, {“id”: 21, “nombre”: “fisica”}] and so several records that its array in the CLOB

Is it possible to have a nested where and and clause in oracle sql?

I’ve tried search for this and I’m not sure I’m using the correct terminology, but is it possible to have a nested WHERE AND clause?: So the nested AND would “and (age != 18 and hair_colour != black)” so you could have: first_name = ‘Jay’ evaluate to true last_name = ‘McDonald’ evaluate to true (age = 18 and hair_colour =

Oracle chr() diferent returns from SQL engine versus PL/SQL engine, why?

Same function, same argument, different outputs: PL/SQL procedure successfully completed. Answer In your case, chr() appears to be performing an implicit conversion to binary_float (IEEE 754 floating-point representation) as the datatype, as opposed to number (ANSI SQL NUMERIC). This results in different rounding results. I cannot duplicate your results on 19c unless I force the datatype, in which case I

Oracle SQL – Create Sequence and add sequence values on new column

I have the following table called table_1 I create a new column_3 then I create a sequence CREATE SEQUENCE “sequence_1” MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE NOPARTITION and I alter the table_1 so the default for new values on column_3 are the the values of the sequence. ALTER TABLE table_1 MODIFY column_3

Why are these 2 queries giving different outputs?

Query no 1:- The Query 1 gives me the following output:- Query no 2:- The Query 2 gives me the following output:- Answer Summary: The AND operator has higher precedence than the OR operator. To fix it, use brackets around the OR expression. AND has higher precedence than OR so your first query is the equivalent of (with added brackets

Advertisement