Given a specific SELECT
statement, how can I (using SQL Server 2008 as a minimum) return 2 identical rows for each row in the SELECT
?
I need to create an export CSV file for my client, who will use it to import data into another system. That other system requires 2 rows of identical data for each of the rows of data in my database... don't ask why, I don't know, it just does.
The SELECT
is pretty complex, and returns nearly 100 columns of information.
The easiest solution would be to replicate the entire SELECT
with a UNION ALL
, but that is messy and could potentially result in faults if somebody updates one of the selects and forgets to update the other one (which should never happen, however we're all human).
Is there an easy INNER JOIN
technique that could be used to do this, or am I looking at temporary tables/CTEs?