कोशिश करें:
With DependencedIncidents AS
(
SELECT INC.[RecTime],INC.[SQL] AS [str] FROM
(
SELECT A.[RecTime] As [RecTime],X.[SQL] As [SQL] FROM [EventView] AS A
CROSS JOIN [Incident] AS X
WHERE
patindex('%' + A.[Col] + '%', X.[SQL]) > 0
) AS INC
),
lalala AS
(
SELECT INC.[RecTime],INC.[SQL] AS [str] FROM
(
SELECT A.[RecTime] As [RecTime],X.[SQL] As [SQL] FROM [EventView] AS A
CROSS JOIN [Incident] AS X
WHERE
patindex('%' + A.[Col] + '%', X.[SQL]) > 0
) AS INC
)
और हाँ, आप सामान्य तालिका अभिव्यक्ति परिभाषा के अंदर सामान्य तालिका अभिव्यक्ति का संदर्भ दे सकते हैं। पुनरावर्ती रूप से भी। जो कुछ बहुत ही साफ तरकीबों की ओर ले जाता है। ए> ।