Hoping someone can help me with this. I am rewriting an Alteryx Workflow into SQL and in the workflow there is a left, inner and right join. When I write my sql to replicate the left and inner join I get the same number of records as the Alteryx workflow does but I'm having an issue with the right join. I should be getting 25 records but my workflow keeps giving me 17(the same as the results of the left and inner join are giving). Table 1 has only quote number 10 and 11(which fill 17 rows of data) in it but table 2 has all 10 quotes so with a right join I expected to see my results showing the 2 quotes from table 1 which would fill 17 rows similar to the left and inner join but also populate the rest of the results with the other 8 rows of missing quotes to give me 25 rows in total. Why isn't this happening? Why is the right join not giving me the quotes that table1 doesn't have? Below is the query:
SELECT
table2."Quote No",
table1."Quote No",
table1.*
FROM table1
right JOIN
(
SELECT distinct
"Quote No"
FROM Table2
GROUP BY 1
)table2 ON table2."Quote No"=table1."Quote No"
WHERE 1=1
AND table1."Quote No" IN ('10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20')