How to upload data from previous year if this year's data is unavailable

How to upload data from previous year if this year's data is unavailable

TABLE : TEST

TABLE : TEST

Batch   Year    Value
----------------------
A   2014    11
A   2015    0
A   2016    22
A   2017    0
A   2018    13
B   2015    10
B   2016    0
B   2017    29
B   2018    0
C   2013    24
C   2014    0
D   2015    27
D   2016    0

Herein batchwise suppose data is not there in 2015 it should take data from 2014, similarly if data is unavailable in a particular year for a particular batch then data from the previous year should be allocated to that year.

I tried to put case statement by taking only batch A but the problem is that my query is showing subquery return multiple rows.

SELECT BATCH, YEAR,
(CASE WHEN VALUE = 0 THEN
(SELECT A.VALUE FROM TEST A, TEST B WHERE A.YEAR = B.YEAR-1 AND A.VALUE <> '0') ELSE VALUE END)
FROM TEST;

Required Output table:

Test

Batch   Year    Value
---------------------
A   2014    11
A   2015    11
A   2016    22
A   2017    22
A   2018    13
B   2015    10
B   2016    10
B   2017    29
B   2018    29
C   2013    24
C   2014    24
D   2015    27
D   2016    27


Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

An Introduction to Oracle SQL

An Introduction to Oracle SQL: A quick tour of the six principal clauses of the SELECT statement.

What are the differences between Standard SQL and Transact-SQL?

In this article, we'll explain syntax differences between standard SQL and the Transact-SQL language dedicated to interacting with the SQL

SQL Server Tutorial For Beginners - Learn MS SQL Server with Examples

SQL Server Tutorial For Beginners, Microsoft SQL Server Tutorial, SQL Server Training. Microsoft SQL Server explains all the fundamentals of MS SQL Server with examples. What is DBMS? What is SQL? What is SQL Server? SQL Server Installation