Bhuvnesh (1/11/2010)
thanks for ur reply but its not working
There's always a danger of this when there's no sample data to test against. Could you provide some details of why it's not working?
Does it fail with an error?
Does it provide the correct row count?
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden