Forum Replies Created

Viewing 15 posts - 646 through 660 (of 1,473 total)

  • RE: Cannot perform an aggregate function on an expression containing an aggregate or a subquery

    I'm not sure I understand what you're saying. Did you have a look at the link I posted? Your query wasn't even close to a running state before,...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Remove column from resultset

    Bitbucket is hinting at the second way to do this, that I disregarded (possibly prematurely) because it's not dynamic. You need to know what every possible combination of columns...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: yet anpther prob unpivot and joining

    Yeah, sorry, I have a bad habit of editing previous posts that people might have already read with more info. I really need to stop that.

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Cannot perform an aggregate function on an expression containing an aggregate or a subquery

    Your syntax is off in many different ways. Take a look at this thread, I just fixed a very similar query for someone else last week.

    http://www.sqlservercentral.com/Forums/Topic785369-338-1.aspx

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Remove column from resultset

    Some simple Dynamic SQL + COUNT DISTINCT would get you there... but that's pretty messy.

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Populating a Calendar table?

    Greg Snidow (9/16/2009)


    Garadin Both have advantages and disadvantages

    Well I can see one, which is that mine is limited to only one year at a time. Other than that, yours...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Populating a Calendar table?

    Similar to what Greg posted, here is another method. Both have advantages and disadvantages, but together they should give you a good idea of how to use a tally...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: yet anpther prob unpivot and joining

    Did you see my edit? You actually had 2 problems.

    This code works perfectly fine:

    --// lets create the source data

    CREATE TABLE tblSource

    (

    ...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: yet anpther prob unpivot and joining

    Does it? Or did you just forget the

    WHERE oldv.oldvalue newv.newvalue

    😉

    [Edit:] Also, in your test code, you're not generating new unique identifiers for the last two...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Populating a Calendar table?

    This is a pretty simple query if you're familiar with Tally/number tables. Take a look at the article in my signature for a full explanation of what a Tally...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: optimize insert statement

    That's not enough information for us to go off of. Are there any triggers on the table? Locking Contention possibly? We need a bit more information about...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Syntax run time error on view

    lmu92 (9/15/2009)


    I'd guess that the problem is within the definition of your view rather than the STARTDATE column in the SELECT clause.

    Reason: The values provided for STARTDATE exceed the tinyint...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Syntax run time error on view

    Try this.

    SELECT * FROM CONTACTCALLDETv1 WHERE StartDate = 'Other'

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Request help with a query

    Bob Hovious (9/15/2009)


    I can't argue with "It depends."

    I'm curious, Seth: Did you capture any times or stats for your million row test?

    I examined...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Request help with a query

    Jonathan


    I logged in today because Steve wrote that he was (finally) making screen names unique (which we had discussed when he switched board software), and I wanted to see what...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

Viewing 15 posts - 646 through 660 (of 1,473 total)