Yes but you will only get one loadId, not one for each type with your query. You can do that if you group by the type.
Not touched DB2 in years, but a quick google suggests it has a similar CTE syntax. Its probably overkill in this case and you could actually rewrite it like this (I rewrote both in terms of tables in a db here and they each give the same results).
There’s a reasonable chance it will help the query optimiser do a decent job and it is at least more readable when you come back to it in 12 months 🙂
If you do use the CTE version, it needs the group by statement at the bottom of this query adding to it. Add an additional WHERE clause to filter the accounts as per your initial post.
SELECT latestLoadIds.data_type, COUNT(Account_Unique_ID)
FROM Account A
JOIN
(
SELECT MAX LoadId, data_type FROM RefData_Load_Log
WHERE b.data_type IN ( “ABC”, “XYZ” )
GROUP BY data_type
) latestLoadIds ON latestLoadIds.loadId = A.LoadId
GROUP BY latestLoadIds.data_type