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

  • krotoflik

    krotoflik

    26 ŞUBAT 2011
  • KRQE

    KRQE

    6 AĞUSTOS 2007
  • bored before i even began

    bored before

    30 Mart 2009