• RamSteve (10/9/2013)


    Hi ,

    All of the posts here work and the one i gave also works but i am looking for other ways of doing it in a simple manner and with good performance ,

    Thanks every one for all the post and keep posting your query here if you have any different ways of doing it .

    Thanks again for all your valuable time and knowledge you have shared over here

    I can't speak for anybody else but I am not a big fan of trying to think of ways a query might work against a non existent table. If you want the fastest way to accomplish this you need to post the details of your table(s). Otherwise, glad you were able to figure out something that works.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/