Ispirer Website Ispirer Capabilities - Oracle Migration Free Trial

Oracle Last_value function to HiRDB

Last_value function with range between unbounded preceding and unbounded following

With order by the same colon as in last_value function

HiRDB database has equivalent for last_value function with range between unbounded preceding and unbounded following with order by the same colon as in last_value function. SQLWays changes last_value function with subselect with MAX function.

Oracle:

select col3, last_value(col1) over (partition by col2 order by col1 range between unbounded preceding and unbounded following) as 
last_v_al from test_upd_sel where col4=col5 or col5=col6; 

HiRDB:

select col3, (select max(col1) from test_upd_sel Swt_Alias where (col4=col5 or col5=col6) and Swt_Alias.col2=test_upd_sel.col2) as 
last_v_al from test_upd_sel where col4=col5 or col5=col6;

With order by the colon not as in last_value function

HiRDB hasn't equivalents for Last_value function with range between unbounded preceding and unbounded following with order by the colon not as in last_value function. SQLWays leaves it as is and adds message /* Сould not convert 'last_value' */.

Oracle:

select col3, last_value(col1) over (partition by col2 order by col3 range between unbounded preceding and unbounded following) as
last_v_al from test_upd_sel where col4=col5 or col5=col6; 

HiRDB:

select col3, last_value(col1) over (partition by col2 order by col3 range between unbounded preceding and unbounded following) as
last_v_al from test_upd_sel where col4=col5 or col5=col6;
/* Сould not convert 'last_value' */

Last_value function with rows between unbounded preceding and unbounded following

With order by the same colon as in last_value function

HiRDB database has equivalent for last_value function with rows between unbounded preceding and unbounded following with order by the same colon as in last_value function. SQLWays changes last_value function with subselect with MAX function.

Oracle:

select col3, last_value(col1) over (partition by col2 order by col1 rows between unbounded preceding and unbounded following) as 
last_v_al from test_upd_sel where col4=col5 or col5=col6; 

HiRDB:

select col3, (select max(col1) from test_upd_sel Swt_Alias where (col4=col5 or col5=col6) and Swt_Alias.col2=test_upd_sel.col2) as 
last_v_al from test_upd_sel where col4=col5 or col5=col6;

With order by the colon not as in last_value function

HiRDB hasn't equivalents for Last_value function with rows between unbounded preceding and unbounded following with order by the colon not as in last_value function. SQLWays leaves it as is and adds message /* Сould not convert 'last_value' */.

Oracle:

select col3, last_value(col1) over (partition by col2 order by col3 rows between unbounded preceding and unbounded following) as last_v_al from test_upd_sel where col4=col5 or col5=col6; 

HiRDB:

select col3, last_value(col1) over (partition by col2 order by col3 rows between unbounded preceding and unbounded following) as 
last_v_al from test_upd_sel where col4=col5 or col5=col6;
/* Сould not convert 'last_value' */

Last_value function without window clause

With order by the same colon as in last_value function

HiRDB database hasn't equivalent for Last_value function without window clause with order by the same colon as in last_value function. SQLWays leaves it as is and adds message /* Сould not convert 'last_value' */.

Oracle:

select col3, last_value(col1) over (partition by col2 order by col1) as last_v_al from test_upd_sel where col4=col5 or col5=col6; 

HiRDB:

select col3, last_value(col1) over (partition by col2 order by col1) as last_v_al from test_upd_sel where col4=col5 or col5=col6;
/* Сould not convert 'last_value' */

With order by the colon not as in last_value function

HiRDB hasn't equivalents for Last_value function without window clause with order by the colon not as in last_value function. SQLWays leaves it as is and adds message /* Сould not convert 'last_value' */.

Oracle:

select col3, last_value(col1) over (partition by col2 order by col3) as last_v_al from test_upd_sel where col4=col5 or col5=col6; 

HiRDB:

select col3, last_value(col1) over (partition by col2 order by col3) as last_v_al from test_upd_sel where col4=col5 or col5=col6;
/* Сould not convert 'last_value' */

© 1999-2024, Ispirer Systems, LLC. All Rights Reserved.