Selecting a rowset more than once
Is there a simple and concise way to select the same set of rows repeated based on the count stored in a variable, without using a loop?
For example, suppose it SELECT a, b, c FROM foo WHERE whatsit = something
returns
abc --- --- ---- 1 2 3
... and I am @count
with 3
in it. Is there a sane way without a loop:
abc --- --- ---- 1 2 3 1 2 3 1 2 3
? The order doesn't matter, and I don't need to know which group a given row belongs to. I actually only need this for one line (as above) and a solution that only works for one line will do the trick, but I guess if we can do it for one we can do it for any number ...
+3
source to share