• riya_dave (8/2/2013)


    i am trying to explain it here

    Why do you find it so difficult to read the article about best practices? Why is it so difficult to take a few minutes of your time to put together something that we can actually use to write some code with to help you with your problem? This is really NOT a difficult query to write. It would take Lowell or I probably less than 5 minutes to put together a fully functional query that does exactly what you want. The problem is that writing a query requires 2 things: a table and data. You have so far provided neither of those things in anything resembling a format that is easy to use.

    Maybe the issue here is a language barrier. That is not really a problem. We help people that speak many different languages on a regular basis. How is that we help all those other people so easily? They post ddl and sample in the language that ALL of us on this site have in common. SQL.

    Post your two tables in a format that we can use and also what you expect as the output based on your sample data. If you had done that yesterday this issue would be far behind you and you could get on with your next issue.

    _______________________________________________________________

    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/