• L' Eomot Inversé (9/19/2013)


    Brandie Tarvin (9/19/2013)


    I know half a dozen ways to do what you've requested. But any easier than the easiest way I posted above?

    If you find one, let me know.

    Rather than writing the query you described as the final step of your method, wouldn't it be easier to write

    SELECT * FROM #ALLSELLERS

    EXCEPT SELECT * FROM #WORSTSELLERS

    EXCEPT SELECT * FROM #TOPSELLERS

    or even

    SELECT * FROM #ALLSELLERS EXCEPT (

    SELECT * FROM #WORSTSELLERS UNION ALL SELECT * FROM #TOPSELLERS)

    if you think using brackets makes it less confusing.

    Given the question, I wasn't sure if the OP knew about the EXCEPT operator, so I opted to keep it simple with the very basics I thought (s)he would know.

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.