Convert this Oracle query and its CTEs to SQL Server syntaxt. Declare any needed variables as varchar 255 and set to "ABC". Use stuff() to replace listagg. Remove dual since it is not needed in sql server:

-------

WITH    
    ANIMAL AS (
        SELECT 1 AS ID, 'PANDA' AS NAME FROM DUAL UNION ALL
        SELECT 2 AS ID, 'GOLDFISH' AS NAME FROM DUAL UNION ALL
        SELECT 3 AS ID, 'DOG' AS NAME FROM DUAL UNION ALL
        SELECT 4 AS ID, 'POLAR BEAR' AS NAME FROM DUAL UNION ALL
        SELECT 5 AS ID, 'SNAKE' AS NAME FROM DUAL
    )
    ,ANIMAL_COLOR AS (
        SELECT /* +MATERIALIZE */ 1 AS ANIMAL_ID, 1 AS LINE, 'BLACK' AS COLOR FROM DUAL UNION ALL
        SELECT /* +MATERIALIZE */ 1 AS ANIMAL_ID, 2 AS LINE, 'WHITE' AS COLOR FROM DUAL UNION ALL
        SELECT /* +MATERIALIZE */ 2 AS ANIMAL_ID, 1 AS LINE, 'ORANGE' AS COLOR FROM DUAL UNION ALL
        SELECT /* +MATERIALIZE */ 2 AS ANIMAL_ID, 2 AS LINE, 'BLACK' AS COLOR FROM DUAL UNION ALL
        SELECT /* +MATERIALIZE */ 3 AS ANIMAL_ID, 1 AS LINE, 'BROWN' AS COLOR FROM DUAL UNION ALL
        SELECT /* +MATERIALIZE */ 3 AS ANIMAL_ID, 2 AS LINE, 'WHITE' AS COLOR FROM DUAL UNION ALL
        SELECT /* +MATERIALIZE */ 4 AS ANIMAL_ID, 1 AS LINE, 'WHITE' AS COLOR FROM DUAL
            
    )

SELECT DISTINCT
    SYSDATE 
    ,ADD_MONTHS(SYSDATE,-1) AS "MINUS_ONE_MONTH"
    ,SYSDATE - 1 AS "MINS_ONE_DAY"
    ,DATE '2023-01-01' AS "20230101_HARD_DATE"
    ,:VAR AS "VARIABLE"
    ,an.NAME AS "ANIMAL_NAME"
    ,LISTAGG(ac.COLOR, '; ') WITHIN GROUP (ORDER BY ac.LINE) OVER(PARTITION BY an.id) AS "COLORS"
FROM DUAL
    CROSS JOIN ANIMAL an
    LEFT JOIN ANIMAL_COLOR ac ON an.ID = ac.ANIMAL_ID;

------- The word "date" should not appear in your response.
user