Re: how to join dynamic SQL results with another query
- From: "new DBA in '09" <ericbragas@xxxxxxxxx>
- Date: Tue, 15 Jun 2010 13:18:13 -0700 (PDT)
CELKO, You've given me good advice in the past, but I don't see what
advice you're offering here. I agree that dynamic SQL should be the
last option, but I disagree that it means the schema is bad. I'll
entertain the possibility that I could just be a bad SQL programmer if
you can tell me how to write a pivot query that will dynamically
decide column names in the results as the months pass. In other
words, "Month 1," Month 2," and "Month 3" aren't viable column names;
the last three full months are valid column names, but how to set them
in a pivot query? I'm using this page as a guide: <a href="http://
www.tsqltutorials.com/pivot.php">http://www.tsqltutorials.com/pivot.php</a>.
What is the correct approach, since my approach is wrong?
.
- Follow-Ups:
- Re: how to join dynamic SQL results with another query
- From: --CELKO--
- Re: how to join dynamic SQL results with another query
- References:
- how to join dynamic SQL results with another query
- From: new DBA in '09
- Re: how to join dynamic SQL results with another query
- From: --CELKO--
- how to join dynamic SQL results with another query
- Prev by Date: Re: splitting of data elements - help in best way forward
- Next by Date: Re: how to join dynamic SQL results with another query
- Previous by thread: Re: how to join dynamic SQL results with another query
- Next by thread: Re: how to join dynamic SQL results with another query
- Index(es):
Relevant Pages
|