I have a complex SQL query that involves multiple CTEs that produces results in SSMS with no errors. I am trying use the In-DB Tool to build a workflow around this query, and I am receiving an error message about the "WITH" statement for my CTE. My query does not lend itself well to using subqueries instead of CTEs, so I am looking for a solution that accommodates CTEs.
I have seen previous questions about CTEs but nothing that provided a solution, and I am hoping something has changed since the last response 3 years ago.
Here is a simplified example of my current query.
WITH product_A AS (SELECT PRODUCT_ID
FROM product
WHERE PRODUCT_CATEGORY = 14)
SELECT *
FROM transactions
INNER JOIN product_A
ON transactions.PRODUCT_ID= product_A.PRODUCT_ID
WHERE tranactions.TRANS_DATE >'2/1/2023'
Regular input data supports CTE in the data connection/odbc mode. In-DB does not. I'd do something different with macros...