Sum values ​for each unique ID

I have a query that makes a set of relationships and gives me a number of rows that can be repeated for the same ID_PROD. The THEORETICAL_WEIGHT column will always be the same for a unique ID_PROD, and the REAL_WEIGHT column informs the actual weight that the product had when it was produced. This is… Read More Sum values ​for each unique ID

NULL is not getting matched in case expression in sql

I want to write a query where for my date parameter ‘P_D_IN_END_DT’ if either ’01/01/1900′ or ’01/01/1′ or NULL is passed then i will take ‘sysdate’ else i will take parameter i.e ‘P_D_IN_END_DT’ value only. SELECT CASE WHEN P_D_IN_END_DT IN ( TO_DATE (’01/01/1900′, ‘dd/mm/yyyy’), TO_DATE (’01/01/1′, ‘dd/mm/yyyy’), NULL) THEN TRUNC(SYSDATE) ELSE P_D_IN_END_DT END AS END_DT… Read More NULL is not getting matched in case expression in sql

Need suggestion with Oracle REGEXP_REPLACE function

I am writing an update query where I need to update some values in a column using REGEXP_REPLACE function. I had written the below query which works correctly. update my_table_name set column_name = REGEXP_REPLACE(column_name, ‘"MyValue":0’, ‘"MyValue":2’ ) WHERE column_id=1234; However, after – "MyValue": it can be any number ranging from 0-9. So I am trying… Read More Need suggestion with Oracle REGEXP_REPLACE function

How to add a column that contains the next date column with SQL oracle developper

I want to add a column to my table that contains the next Birthdate (ordered by Birthdate) This is my actuale table: ID Birthdate Personne1 19/11/90 19:14:52,182000000 Personne1 19/11/90 20:00:52,170000000 Personne1 19/11/90 21:00:00,190000000 And I’m looking for this table ID Birthdate nextdate Personne1 19/11/94 90:14:52,182000000 90/11/94 20:00:52,170000000 Personne1 19/11/94 90:00:52,170000000 90/11/94 21:00:00,190000000 Personne1 19/11/94 90:00:00,190000000… Read More How to add a column that contains the next date column with SQL oracle developper

ORACLE SQL number of customers who have ordered something on a date

I have 2 tables involved, the "customers" table and the "orders" table. The "customers" table has the following columns: Customerid, companyname, contactname, contactittle, addresses, city The "Orders" table has the following columns: orderid, customerid, employeeid, orderdate, shippeddate, shipname I have to do where the number of customers who have ordered a product in the year… Read More ORACLE SQL number of customers who have ordered something on a date