Forum Replies Created

Viewing 15 posts - 21,721 through 21,735 (of 26,484 total)

  • RE: Help with SUM

    And it should be noted, that both of my rewrites using the derived table and CTE are equivalent to my original code using the HAVING clause.

    Also, arun.sas, in your code...

  • RE: Help with SUM

    arun.sas (3/30/2009)


    Hi,

    Try this

    select a.weekno,b.invtotal

    from

    invoices as a,

    (

    select weekno,sum(gross) as invtotal

    from invoices

    group by weekno

    )as b

    where

    a.weekno = b.weekno

    and b.invtotal > 10000

    ARUN SAS

    As this is SQL Server 2005, you really...

  • RE: Help with SUM

    RBarryYoung (3/30/2009)


    Hey, Lynn got to use HAVING! Wohoo! 😛

    I think that we ought to award a prize anytime someone gets to use HAVING legitimately. 😀

    You know, if I...

  • RE: Sort Order Help Please

    Looks like you need to use the Latin1_General_BIN or Latin1_General_BIN2 collation to get the sort order you want. My test code:

    select * from (

    select 'Pr1' as Title union all

    select...

  • RE: Sort Order Help Please

    It is one way. I'm still wondering what your collation is on your system. Latin1_General_BIN2 is a case sensitive collation. Your server may be using a case...

  • RE: Sort Order Help Please

    What is your system/database collation? It works fine on my system, collation Latin1_General_BIN2.

  • RE: Help with SUM

    Try this:

    select

    weekno,

    sum(gross) as invtotal

    from

    invoices

    group by

    weekno

    having

    sum(gross) > 10000

    order by

    ...

  • RE: Help!

    Oh well, guess 80 compatibility mode allows some things that the actual SQL Server 2000 engine won't. It worked fine on my SQL Server 2005 system with a database...

  • RE: Are the posted questions getting worse?

    Jeff Moden (3/30/2009)


    Lynn Pettis (3/30/2009)


    Jan Van der Eecken (3/30/2009)


    Geez, you are quick to pull out the rule book. Admitted, the pic is about the red card in the finals of...

  • RE: Are the posted questions getting worse?

    Jack Corbett (3/30/2009)


    Lynn Pettis (3/30/2009)


    Jack Corbett (3/30/2009)


    Lynn Pettis (3/30/2009)


    Jan Van der Eecken (3/30/2009)


    Geez, you are quick to pull out the rule book. Admitted, the pic is about the red card...

  • RE: Are the posted questions getting worse?

    Jack Corbett (3/30/2009)


    Lynn Pettis (3/30/2009)


    Jan Van der Eecken (3/30/2009)


    Geez, you are quick to pull out the rule book. Admitted, the pic is about the red card in the finals of...

  • RE: Are the posted questions getting worse?

    Bob Hovious (3/30/2009)


    Let me interrupt to drag the conversation away from futbol.

    Lynn!! Lynn!! I actually had someone say they had an "ah-hah" moment... with respect to setting...

  • RE: Are the posted questions getting worse?

    Actually, it's called anticipating where play is going so that you can be there to make (or not make) the appropriate call.

    We aren't out there to call the doubtful or...

  • RE: SQL 2000 - RANKING

    Look carefully at the clustered index. That is what makes this work. Based on your sample data and expected results it is actualy based on BatchNo, ColID.

    Edit:

    Unfortunately, the...

  • RE: Are the posted questions getting worse?

    This is the "Water Cooler", all topics are fair game here.

Viewing 15 posts - 21,721 through 21,735 (of 26,484 total)