Skip to Main Content

ORDS, SODA & JSON in the Database

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Modify time in ords.war comes from far future

Sasha GomanukeSep 21 2018 — edited Sep 21 2018

Hi!

Can somebody explain what is the sense of that (modify time from future, look at attached file)? What's about me it leads to problem with tar while restoring lxc container of ProxMox 5:

tar: ./opt/apache-tomcat-9.0.10/webapps/oblako/scripts/upgrade/ords_upgrade_1740_316.sql: time stamp 2025-09-27 08:13:20 is 221463421.804963894 s in the future

Appreciate for advice how to return back in present.

Comments

John Thorton

Gayathri Venugopal wrote:

DayEnd
Reorder
SalesDayInventory
Quantity
DayStart
390392564
6454106575
756510818

Above is the output of the expected data. From the second row of DayEnd, I need to take the value of the previous row of the DayStart.How do I do that.If you observe the values of DayEnd, it would have the data of the previous row value of the DayStart.

Please click on URL below & provide details as stated in #5 - #9 inclusive

How do I ask a question on the forums?

We don't have your table.

We don't have your data.

We don't have your requirements.

Manik

Question unclear... are you looking for LEAD LAG functions of oracle?

Cheers,

Manik.

Peter Boekelaar

There...

with test_data as
( select 0 reorder, 39 sales_day_inventory, 25 quantity, 64 day_start from dual union
  select 54,10,65,75 from dual union
  select 65,10,8,18 from dual)

select lag(day_start) over (order by reorder) day_end
   , reorder
   , sales_day_inventory
   , quantity
   , day_start
  from test_data

Gayathri Venugopal

Hi i am using mysql server version 8 I am getting an error like this: Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(order by ShippedDate) DayEnd    , reorder    , sales_day_inventory    , quantity' at line 1 0.000 sec

Peter Boekelaar

Uhmmm... you posted this question without any context in a forum for Oracle. Did you expect the same syntax?

Please post your question on a MySQL forum

John Thorton

duplicate thread

Please don't post MYSQL issues in Oracle forum

Gaz in Oz

In Oracle database it would look like this, for example:

https://docs.oracle.com/en/database/oracle/oracle-database/12.2/sqlrf/LAG.html

with x as (

   select  0 reorder, 39 sales_day_inventory, 25 quantity, 64 day_start from dual union all

   select 54,         10,                     65,          75           from dual union all

   select 65,         10,                      8,          18           from dual

)

select lag(day_start, 1, sales_day_inventory) over (order by reorder) day_end,

       reorder,

       sales_day_inventory,

       quantity,

       day_start

from   x;

   DAY_END    REORDER SALES_DAY_INVENTORY   QUANTITY  DAY_START

---------- ---------- ------------------- ---------- ----------

        39          0                  39         25         64

        64         54                  10         65         75

        75         65                  10          8         18

3 rows selected.

SQL>

In mysql 8 and above it would look like this:

https://dev.mysql.com/doc/refman/8.0/en/window-function-descriptions.html#function_lag

with x as (

   select  0 reorder, 39 sales_day_inventory, 25 quantity, 64 day_start from dual union all

   select 54,         10,                     65,          75           from dual union all

   select 65,         10,                      8,          18           from dual

)

select lag(day_start, 1, sales_day_inventory) over w day_end,

       reorder,

       sales_day_inventory,

       quantity,

       day_start

from   x

window w as (order by reorder);

As usual it is all laid out in the respective documentation.

LAG() function in mysql did not exist till version 8.

1 - 7
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Oct 19 2018
Added on Sep 21 2018
0 comments
92 views