SELECt Location FROM Table1 CROSS JOIN ( VALUES (1),(2),(3),(4) ) AS four(dummy)
如果
4不是一个常数,而是(如@xQbert指出/要求的)是表的行数,则可以使用以下命令:
SELECt a.Location FROM Table1 AS a CROSS JOIN Table1 AS b
如果没有
Table1任何查询(但是很复杂),则可以将其用于4个副本:
SELECt Location FROM ( SELECt Location --- complex query here ... --- inside parenthesis UNIOn SELECT Country ... ) AS Table1 CROSS JOIN ( VALUES (1),(2),(3),(4) ) AS four(dummy)
或此
n副本:
WITH cte AS ( SELECT Location --- complex query here ... --- inside parenthesis UNIOn SELECT Country ... )SELECT a.Location FROM cte AS a CROSS JOIN cte AS b
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)