Isn’t this what the LAST_VALUE window function does? If so, that’s a standardized SQL syntax which is supported in both postgresql and recent versions of MySQL.
https://www.postgresqltutorial.com/postgresql-last_value-fun...
https://www.postgresqltutorial.com/postgresql-last_value-fun...
So it would be:
select a, last_value(b) over(partition by a), last_value(c) over(partition by a) from table
Note the lack of a "GROUP BY" so this will result in duplicates unless you add a DISTINCT.