Home Forums SQL Server 2008 SQL Server Newbies Update query for my new boss in my new job I am struggling with RE: Update query for my new boss in my new job I am struggling with

  • I'm not so sure either - the tables might look like this:

    DROP TABLE #Table1

    SELECT

    *

    INTO #Table1

    FROM (

    SELECT Column1 = 'microsoft outlook 2007,microsoft 2007 outlook,microsoft out look 2007,microsoft 2007 office,microsoft office 2007'

    ) d

    DROP TABLE #Table2

    SELECT

    *

    INTO #Table2

    FROM (

    SELECT

    Column1 = 'microsoft outlook 2007,microsoft 2007 outlook,microsoft out look 2007,microsoft 2007 office,microsoft office 2007',

    Column2 = 'outlook 2007,office 2007'

    ) d

    SELECT * FROM #Table1

    SELECT * FROM #Table2

    in which case it's changed from a trivial exercise to an interesting one ๐Ÿ˜‰

    โ€œWrite the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.โ€ - Gail Shaw

    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