Forum Replies Created

Viewing 15 posts - 5,851 through 5,865 (of 10,144 total)

  • RE: Cannot get Left JOIN to work correctly

    SELECT *

    FROM

    (SELECT DealerCode FROM Sales GROUP BY DealerCode) m

    CROSS JOIN Forecast fc

    LEFT JOIN [Sales] s on s.DealerCode = m.DealerCode AND s.ForecastID = fc.ForecastId

    ORDER BY m.DealerCode

  • RE: Annoying join problem & frozen brain.

    SELECT *

    FROM D

    LEFT OUTER JOIN a

    ON A.a = D.a

    WHERE

    A.b = 1 -- << this turns the LEFT OUTER JOIN into an INNER JOIN

    AND D.a IN (1,2,3,4)

    -- use this...

  • RE: Will indexed view help this query?

    -- The query requires a scan of the whole 100M rows to evaluate the ORDER BY.

    -- An index with Destination, Origin, Airline and Tax will help.

    -- You *probably* don't need...

  • RE: Are the posted questions getting worse?

    GilaMonster (8/21/2012)


    <soapbox>

    Cursors are tools. Use them where they work, don't use them where they don't. Statements like 'you should never use a <whatever>' are just shortsighted

    If we count while loops...

  • RE: Today's Random Word!

    rhythmk (8/20/2012)


    Cliff Jones (8/20/2012)


    Scott D. Jacobson (8/20/2012)


    SQLRNNR (8/20/2012)


    Ray K (8/20/2012)


    Manic Monday

    The Bangles

    Susanna Hoffs and Matthew Sweet.

    Ming Tea

    Green Tea

    Green Day

  • RE: Are the posted questions getting worse?

    dwain.c (8/21/2012)


    It has been a rare experience for me to post a question to this forum, but I will now. How about a poll?

    Yesterday I was called upon to...

  • RE: Are the posted questions getting worse?

    Stefan Krzywicki (8/20/2012)


    Brandie Tarvin (8/20/2012)


    ChrisM@Work (8/17/2012)


    Pet rent? Never heard of that over here.

    Landlords in the States are adding it to the usual rental fees as a way to discourage pet...

  • RE: need to fetch the value between two delimiter

    SELECT -- resolve "word" between 5th and 6th pipe characters using Cascaded (CROSS) APPLY

    WordInRow3 = SUBSTRING(row3,r5.p+1,(r6.p-r5.p)-1)

    FROM (SELECT Stringy = @text, LineDelimiter = CHAR(13)+CHAR(10)+CHAR(13)+CHAR(10)) d

    CROSS APPLY (SELECT p = CHARINDEX(LineDelimiter,Stringy,1)) x1

    CROSS...

  • RE: Today's Random Word!

    SQLRNNR (8/17/2012)


    jasona.work (8/17/2012)


    Daniel Bowlin (8/17/2012)


    bcsims 90437 (8/17/2012)


    Cliff Jones (8/17/2012)


    ChrisM@Work (8/17/2012)


    SQLRNNR (8/17/2012)


    behemoth

    Tiger moth

    Tiger Shark

    Shark week!

    Pool shark

    Bulette!

    (Landshark)

    Loan Shark - the worst kind.

    Interesting

  • RE: group data by week

    jfowler 10337 (8/17/2012)


    i read it....my mind just doesn't get computer code lingo all that well. If I posted the data of the tables I'm pulling from it would be...

  • RE: Crazy Interviews

    Stuart Davies (8/17/2012)


    ChrisM@Work (8/17/2012)


    Stuart Davies (8/17/2012)


    ChrisM@Work (8/16/2012)


    Earlier this year I had an interview for a gig right next to Swindon station, a dream forty-minute commute compared with the two hours...

  • RE: group data by week

    jfowler 10337 (8/17/2012)


    ok, thanks. I was hoping it would be something as simple as looking at the code and changing something in the grouping. I've inherited the code,...

  • RE: group data by week

    jfowler 10337 (8/17/2012)


    i just need things grouped by week starting with Monday and ending on Thursday.

    There are 13 selects in your query - each one has to be aggregated at...

  • RE: group data by week

    jfowler 10337 (8/17/2012)


    i just need things grouped by week starting with Monday and ending on Thursday.

    No problem.

    Run the results into a temp table, index it, and select with an aggregate.

  • RE: Today's Random Word!

    SQLRNNR (8/17/2012)


    behemoth

    Tiger moth

Viewing 15 posts - 5,851 through 5,865 (of 10,144 total)