Forum Replies Created

Viewing 15 posts - 961 through 975 (of 4,080 total)

  • RE: Selecting Max(ID)

    It depends. The Row_Number() technique wins at low volumes and the MAX() function performs better as you start moving up to to tens of thousands of rows....

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: How to use temporary table in function

    This post intentionally left blank.

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Selecting Max(ID)

    bubs,

    This may be an irrelevant question, but how many rows are you planning on running against? If this is a one time shot it's...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: A search with a Rank

    I am about to go out of town for several days, so this will be my last post, but you seem to be on the right track. ...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: A search with a Rank

    I don't really know of anything more "comprehensive". Ranking is based on a criteria of some sort which must be defined. In your example for...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Select phone numbers depending on priority

    Chrissy,

    Please note that the query using the revised design provides output in this format

    Staff_ID Phone_nbr

    1 ...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: A search with a Rank

    Sounds like an interesting problem, but we need a little more help before we can offer a solution.

    Could you give us a little more information?

    What would...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Help with two SQL issues

    You're welcome.

    CTEs are just like views, except you define them for the duration of a single query.

    Alternatively, think of them as subqueries that you read from top to bottom,...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Pivot Problem

    Try this instead of the PIVOT. See if it helps.

    select site

    , sum(case when [status] = 'Available' then 1 else 0 end) as Available

    , sum(case when [status]...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Help with two SQL issues

    Here's a shot at your first requirement. For a high-volume table I'd probably use a cursor, or even let the calling application highlight the consecutive rows....

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Select phone numbers depending on priority

    You get an A+ for setting up the problem so perfectly. Thank you so much!! 😀

    Here's a solution for you

    select StaffID

    ,COALESCE(case...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Are the posted questions getting worse?

    GilaMonster (7/20/2011)


    Ninja's_RGR'us (7/20/2011)


    GilaMonster (7/20/2011)


    Jeff Moden (7/20/2011)


    I understand that Gail Shaw will be co-presenting with you...

    Yup, Grant and I are doing comed^H^H^H^H^H execution plans as a precon on the Monday.

    What...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Are the posted questions getting worse?

    ... and he feeds pork chops to the hungry multitudes.

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Checking for patterns in a int

    Call the people at SETI[/url]. 😀

    Seriously, I think T-SQL may be the wrong tool for the job of discovering undefined patterns. This sounds like it's more in...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Aggregate Functions

    Thanks, Theomed. 🙂

    They aren't rules; they are just suggestions. But they are REALLY helpful suggestions.

    What you posted, enabled me to produce this...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

Viewing 15 posts - 961 through 975 (of 4,080 total)