Home Forums SQL Server 2008 T-SQL (SS2K8) AVOID JOINING ON TO THE SAME TABLE MULTIPLE TIMES? RE: AVOID JOINING ON TO THE SAME TABLE MULTIPLE TIMES?

  • Short form: You're pivoting your data. You're going to have to call the data multiple times to selectively choose what you're pivoting with.

    Now, you could do a temp table pull of the data to limit what you need to pivot on, but that's probably not going to get you far. You could do an inline PIVOT after the grab with multiple rows, but that's going to get very complex and it's also an expensive operation.

    Really, without digging deeply into your structure, indexes, query plans, and the like... you're pretty much stuck with what you've got.


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA