is like this
2
sql4alias_namealias_name2alias_name3
is like this
2
sql4alias_namealias_name2alias_name3
use the window function of oracle. The field of the screenshot cannot be seen clearly. Please indicate it in the way of col1,col2,col3
.select *
from (
select t.*,
row_number() over (partition by col1, col2, col3, col4 order by alias_id) as rank_id,
lead(amount) over (partition by col1, col2, col3, col4 order by alias_id) as alias_name2,
lead(amount, 2) over (partition by col1, col2, col3, col4 order by alias_id) as alias_name3
from t
order by col1, col2, col3, col4, alias_id
)
where rank_id = 1
according to the query results above, you can save to the temporary table first, and then reinsert the data from the temporary table after the source table is emptied.
Previous: Libevent-devel error occurred during pip install cryptography
Next: What's the difference between a relational schema and a relational schema diagram?