November 12, 2008 at 8:28 am
Hello All,
I have a requirement where I need to introduce duplicate records in the result set with an SQL statement.
For example, I have an sql pulling back data and the result set looks as follows
CustomerCompanyCode
1234C1ABC
2345C2PQR
Could anyone please let me know what I can do to make the above result set repeat twice. I don't want to use the query twice and do UNION ALL.
CustomerCompanyCode
1234C1ABC
1234C1ABC
2345C2PQR
2345C2PQR
Thanks,
-Amith Vemuganti
November 12, 2008 at 8:34 am
You could add
cross join (select 1 union all select 2) X(Y)
into your query
____________________________________________________
Deja View - The strange feeling that somewhere, sometime you've optimised this query before
How to get the best help on a forum
http://www.sqlservercentral.com/articles/Best+Practices/61537November 12, 2008 at 8:42 am
Great, its working. Thanks so much Mark!
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply