Forum Replies Created

Viewing 15 posts - 781 through 795 (of 1,183 total)

  • RE: Filter on INNER JOIN

    It's my understanding that the query optimizer treats them both the same.

  • RE: How to combine SQL queries

    Ah Ha!

    Thanks.

  • RE: INSERT A Record Based on Count

    Jeff,

    Actually, after you asked, I did a bit more testing and I was completely backwards in my statement.

    So if anyone wants to double check, please do.....

    I built a testData table...

  • RE: How to combine SQL queries

    Peter Larsson (11/8/2007)


    Use "UNION ALL" or "UNION".

    Peter, do you have any reasoning why UNION or UNION ALL would be preferred over my solution? Just curious.

  • RE: How to combine SQL queries

    Wade,

    One thing, you're not handling the case when the EXPIRATION field is equal to 1/1/07, but my code below does. It will put those records into the expired group.

    SELECT

    ...

  • RE: INSERT A Record Based on Count

    Adam Haines (11/8/2007)


    Jason,

    Which script from PW did you compare to yours, the CTE or the subquery one?

    the CTE

  • RE: INSERT A Record Based on Count

    Wow, that's pretty nice PW!

    Trigger, can you run both of these against your data and get the execution stats. My test shows PW's is a HUGE amount faster.

  • RE: INSERT A Record Based on Count

    AH, you fixed your code right as I made my last post.... LOL

  • RE: INSERT A Record Based on Count

    Adam Haines (11/8/2007)


    Great solution Jason. 😉

    The original specification required that the data be in a not incrmental format. For example, if A11 has 2 then it should be...

  • RE: How to group by Academic Year..

    😀

    Now that's funny, but it just goes to show something that I learned a long time ago and struggle to remember every day and that's "Don't assume anything" .... *grin*

    No...

  • RE: How to group by Academic Year..

    Dfalir,

    Take a look at Matt's post. He's said it a bit better than I have. But I believe my code does exactly what you stated. Other than your definition doesn't...

  • RE: How to group by Academic Year..

    I think we're not querying with the same restrictions here. My queries do NOT incorporate an end date as you defined in the first post. What do you get when...

  • RE: How to group by Academic Year..

    Dfalir (11/8/2007)


    .... Keep in mind that the years presented are not fixed. They are just 3 years and on from the current year. For example when 2008 come, the...

  • RE: How to group by Academic Year..

    The only thing I can see is the

    TC_NUMBER LIKE ('%' + @Centre + '%')

    vs.

    TC_NUMBER = '0009'

    Are the results still different if you change that part of the test query?

    FYI,...

  • RE: SQL query need help!!! urget

    Point well made Bob. 😀

Viewing 15 posts - 781 through 795 (of 1,183 total)