Rank: Member
Groups: Registered
Joined: 4/7/2019(UTC) Posts: 24 Thanks: 7 times
|
Hello. I need to generate a model that should include a CTE. Before generating a SQL model, I was wondering how can I implement it using a meta model. Which object/element should I define in order Seal generates automatically the correspond CTE clause?
Thanks.
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 12/20/2013(UTC) Posts: 1,209 Thanks: 14 times Was thanked: 206 time(s) in 199 post(s)
|
You can use CTE clause in all SQL... Using the server manager, create a new table and enter the SQL, it should work. example for SQLServer: Code:with cols2 as (select * from sys.columns)
select * from cols2
Then if you create a model with this table the SQL generated will look like: Code:with cols2 as (select * from cols)
SELECT DISTINCT
CTETable.object_id AS C0,
CTETable.name AS C1
FROM (
select * from cols2
) CTETable
ORDER BY CTETable.object_id ASC,CTETable.name ASC
Edited by user Monday, January 27, 2020 8:09:02 AM(UTC)
| Reason: Not specified
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.