SORU
21 Mart 2011, PAZARTESİ


&Quot; çok "kullanabilir miyim?

sadece örneğin

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
)

With 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
)

işe yaramıyor. "Yakın". hata

Ayrıca ilk saniye içinde kullanmak istiyorum. Gerçek ya ben temp tabloları kullanmak gerekir mi ?

CEVAP
21 Mart 2011, PAZARTESİ


Deneyin:

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
)

Ve evet, ortak tablo ifade tanımı içinde ortak tablo ifade başvurabilirsiniz. Hatta özyinelemeli olarak. 4* *bazı çok yol açar.

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • EatingIn

    EatingIn

    12 EKİM 2013
  • Jonathan Flavell

    Jonathan Fla

    1 HAZİRAN 2006
  • laptopmag

    laptopmag

    25 Ocak 2008