Home Forums SQL Server 2008 T-SQL (SS2K8) Using Results from one column to calculate another column RE: Using Results from one column to calculate another column

  • Use CROSS APPLY.

    SELECT

    x.Results1,

    CASE WHEN x.Results1 > 42 THEN ...

    FROM ...

    CROSS APPLY (SELECT... VERY LONG FORMULA as Results1) x

    WHERE x.Results1 = something

    Give it a shot. Without sight of your current query, it's difficult to say more.


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]