Hello professionals,
i have two tables like this:
I want to write Sql query to get the record with the MAX begda.
(25/10/2022)
single record only from all tables.
I tried to do something like this
SELECT
MAX( BEGDA )
massn
pernr
FROM (
SELECT pernr begda massn
FROM pa0000
UNION ALL
SELECT pernr begda massn FROM pa0302) AS a
INTO CORRESPONDING FIELDS OF TABLE gt_pa0000
UP TO 1 ROWS.
and i tried with CASE:
SELECT a~pernr
a~massn
a~begda
FROM pa0000 as a LEFT JOIN pa0302 AS b ON a~pernr = b~pernr
CASE a~begda > b~begda THEN a~begda
ELSE a~begda < b~begda THEN b~begda END.
:it's not work.
please help me :)
thanks.