• daniel.globalstudio (5/28/2015)


    thanx, but don´t understand, i see that there are matches in the two first queries

    https://drive.google.com/file/d/0BwS3pZe3vTTxZmtrQXpvbmhXT3M/view?pli=1%5B/quote%5D

    Look again...there are NO matches.

    Your first query has MLA10168, MLA10182, MLA10183, MLA10193, MLA1051, MLA1052, MLA1053, MLA1054, MLA1055, MLA10616

    Your second query has MLA30965, MLA30987, MLA30986

    There is nothing between those two that match and you have an inner join so there are no rows returned because that is how many matches there are.

    _______________________________________________________________

    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/