Jump to content

SQL Experts Ravali - Urgent help


vivek1234

Recommended Posts

how to execute dynamic sql in cte... Koncham sample code pampinchandi please.... 

 

Below sql is working for regular sql, but i have dynamic sql, please let me know how to replace the below sql with dynamic sql.

 

With CTE AS 

(select id, date from table 1, table 2,....)

(select min(date), id from CTE group by id)

 

 

 

 

Link to comment
Share on other sites

9 hours ago, vivek1234 said:

how to execute dynamic sql in cte... Koncham sample code pampinchandi please.... 

 

Below sql is working for regular sql, but i have dynamic sql, please let me know how to replace the below sql with dynamic sql.

 

With CTE AS 

(select id, date from table 1, table 2,....)

(select min(date), id from CTE group by id)

 

 

 

 

Select * from cte

 

Ani execute chesi chudu

Link to comment
Share on other sites

With CTE AS 

(select id, date from table 1, table 2,....)

(select min(date), id from CTE group by id)

 

Lekapothe...ee code tho view create chesi...

Select * from dbo.view 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...