Forum Replies Created

Viewing 15 posts - 106 through 120 (of 371 total)

  • RE: Pleae Help with Variable - if this is possible

    Lynn Pettis (3/21/2012)


    How about giving this a try:

    SELECT

    t.ProductionDate,

    t.Shift,

    t.LineNumber,

    t.Cart,

    t.CavityPosition,

    ...

    Best regards,

    Andre Guerreiro Neto

    Database Analyst
    http://www.softplan.com.br
    MCITPx1/MCTSx2/MCSE/MCSA

  • RE: Triangle Join - Can I do it right or a replacement?

    Jeff Moden (3/21/2012)


    sorry... haven't abandoned you. Had to get some sleep because I had to be to work very early to swap some drives on a Dev Box. ...

    Best regards,

    Andre Guerreiro Neto

    Database Analyst
    http://www.softplan.com.br
    MCITPx1/MCTSx2/MCSE/MCSA

  • RE: Triangle Join - Can I do it right or a replacement?

    Jeff Moden (3/20/2012)


    Ummmm... gosh... Ok... I see a couple of things wrong with that idea. Let me first ask what the unit of measure for "Total" is. Is...

    Best regards,

    Andre Guerreiro Neto

    Database Analyst
    http://www.softplan.com.br
    MCITPx1/MCTSx2/MCSE/MCSA

  • RE: How to run multiple SELECT Statements?

    Hi. That's a good answer to the question.

    But maybe the first example will not show all possible results from the three queries because you used "WHERE option1 AND option2 AND...

    Best regards,

    Andre Guerreiro Neto

    Database Analyst
    http://www.softplan.com.br
    MCITPx1/MCTSx2/MCSE/MCSA

  • RE: Triangle Join - Can I do it right or a replacement?

    Evil Kraig F (3/20/2012)


    Whoops, sorry Andre, I somehow glazed right past that's what you meant in the second post.

    No problem. Advices like that one are always great. I appreciate. 🙂

    Best regards,

    Andre Guerreiro Neto

    Database Analyst
    http://www.softplan.com.br
    MCITPx1/MCTSx2/MCSE/MCSA

  • RE: Triangle Join - Can I do it right or a replacement?

    Jeff Moden (3/20/2012)


    Example: Table ProductSummary

    Columns: Date, Product, Vendor, Total

    Rule: One row per day at maximum.

    So, one row per date per product per vendor, correct?

    And you want running totals by day...

    Best regards,

    Andre Guerreiro Neto

    Database Analyst
    http://www.softplan.com.br
    MCITPx1/MCTSx2/MCSE/MCSA

  • RE: Triangle Join - Can I do it right or a replacement?

    Jeff Moden (3/20/2012)


    Please understand my confusion on all of that. Previously you stated...

    It's just an example and, while the MonthTable will always be like that, the ExampleTable may have...

    Best regards,

    Andre Guerreiro Neto

    Database Analyst
    http://www.softplan.com.br
    MCITPx1/MCTSx2/MCSE/MCSA

  • RE: Triangle Join - Can I do it right or a replacement?

    Evil Kraig F (3/20/2012)


    This is basically a running totals query, and I believe that's where Jeff's going with his solution so I won't work the same process twice. 😉

    However, there's...

    Best regards,

    Andre Guerreiro Neto

    Database Analyst
    http://www.softplan.com.br
    MCITPx1/MCTSx2/MCSE/MCSA

  • RE: Triangle Join - Can I do it right or a replacement?

    Jeff Moden (3/20/2012)


    Andre,

    Let's take all the fear out of this. Does the "ExampleTable" CTE accurately represent the columns we need to work with from a real table? Can...

    Best regards,

    Andre Guerreiro Neto

    Database Analyst
    http://www.softplan.com.br
    MCITPx1/MCTSx2/MCSE/MCSA

  • RE: Triangle Join - Can I do it right or a replacement?

    Jeff Moden (3/20/2012)


    Also, look at the potential performance problem in the original code. Look for the arrow with a rowcount of 29. Now, add just 3 more entries...

    Best regards,

    Andre Guerreiro Neto

    Database Analyst
    http://www.softplan.com.br
    MCITPx1/MCTSx2/MCSE/MCSA

  • RE: VIEWS 3

    Great back-to-basics and straightforward question.

    Thank you.

    Best regards,

    Andre Guerreiro Neto

    Database Analyst
    http://www.softplan.com.br
    MCITPx1/MCTSx2/MCSE/MCSA

  • RE: Triangle Join - Can I do it right or a replacement?

    SQLKnowItAll (3/20/2012)


    Why not put your derived table into a CTE as well? Or a temp table? It doesn't address the triangluar join yet, but that's the first thing I noticed....

    Best regards,

    Andre Guerreiro Neto

    Database Analyst
    http://www.softplan.com.br
    MCITPx1/MCTSx2/MCSE/MCSA

  • RE: Triangle Join - Can I do it right or a replacement?

    At least, in the derived table I'm limiting the year range to a specific one (2011, in the example).

    Of course I can always replace the YEAR and MONTH functions to...

    Best regards,

    Andre Guerreiro Neto

    Database Analyst
    http://www.softplan.com.br
    MCITPx1/MCTSx2/MCSE/MCSA

  • RE: Select unique records to insert

    Sean Lange (3/20/2012)


    codebyo (3/20/2012)


    SQLKnowItAll (3/20/2012)


    Why would you use both DISTINCT and GROUP BY? It is redundant for results if you are searching for true duplicates.

    EDIT: Sorry, you did not mention...

    Best regards,

    Andre Guerreiro Neto

    Database Analyst
    http://www.softplan.com.br
    MCITPx1/MCTSx2/MCSE/MCSA

  • RE: Select unique records to insert

    SQLKnowItAll (3/20/2012)


    Why would you use both DISTINCT and GROUP BY? It is redundant for results if you are searching for true duplicates.

    EDIT: Sorry, you did not mention DISTINCT in your...

    Best regards,

    Andre Guerreiro Neto

    Database Analyst
    http://www.softplan.com.br
    MCITPx1/MCTSx2/MCSE/MCSA

Viewing 15 posts - 106 through 120 (of 371 total)