Вы не указали, какой именно SQL-сервер у вас. Вот варианты для MySQL:
WITH `cte` (`id`) AS (
SELECT `ID`
FROM `Orders`
ORDER BY `ID` DESC
LIMIT 3
)
SELECT DISTINCT `op`.`Code`
FROM `cte`
JOIN `OrdersProducts` AS `op`
ON `op`.`OrderID` = `cte`.`id`
SELECT DISTINCT `op`.`Code`
FROM (
SELECT `ID`
FROM `Orders`
ORDER BY `ID` DESC
LIMIT 3
) AS `o`
JOIN `OrdersProducts` AS `op`
ON `op`.`OrderID` = `o`.`id`
SELECT DISTINCT `Code`
FROM `OrdersProducts`
WHERE `OrderID` IN (
SELECT `ID`
FROM `Orders`
ORDER BY `ID` DESC
LIMIT 3
)