You can translate the question and the replies:

Multiple created values in a CTE

Good afternoon, I am trying to use a CTE with multiple values. ie: ;with pd as ( select '12345' ) But I need a large amount of values, and am not sure of the syntax needed to do multiple select's in a CTE in this manner. So I would need 12345, 12346, 12347 etc... as a select inside the CTE. Thanks
CTE
user
28-09-2017 16:49:14 -0400
code

1 Answer

Hi, I was able to create a CTE returning several rows with a Union, here is my query: ``` WITH cte_test(id) as (SELECT 12345 UNION SELECT 12346 UNION SELECT 12347) SELECT id FROM cte_test ``` I think it fits your scenario. Hope this helps!
Denodo Team
03-10-2017 05:02:17 -0400
code
You must sign in to add an answer. If you do not have an account, you can register here