If you have a query like:
with some_CTE as
(...)
select [some_columns]
from
(select [columns]
from complicated query
join some_CTE on ...)
then using either version of Export Results you cannot export the data as a SQL file (or to clipboard as a SQL file) I believe it is because the...