Forum Replies Created

Viewing 15 posts - 1,216 through 1,230 (of 1,473 total)

  • RE: Expressions based on data in the SELECT statement

    What you have right now is an attempt at a correlated subquery. You don't want that. What you want that to be is a derived table.

    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: Need help on performance and integrity

    Not that you asked me... but 😀

    IMO, *just about* any solution involving a loop(or a correlated subquery or a few other things) is not set based. Now, yours might...

    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: How to print null when no sales is present

    The reason it worked when you commented out the WHERE clause is because the WHERE clause is the whole problem in the first place. Putting criteria in your WHERE...

    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: Running Total isn't working in the UPDATE CLAUSE

    Open up profiler and begin a new trace. In the filters, add the exact name of one of your functions with % signs on each side of it. ...

    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: Running Total isn't working in the UPDATE CLAUSE

    From first glance, it looks like you might be running into one of the same issues I did... in that you can't use this method(or at least my experimentation with...

    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: Running Total isn't working in the UPDATE CLAUSE

    You still haven't posted the sample data / DDL I requested in any easily usable format (see the link in my signature if you don't know what that means... and...

    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: Expressions based on data in the SELECT statement

    Without writing any SQL as explanation, I can only be general about what you can try to do (there will be several methods of tackling this issue, this is only...

    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: Is a Recursive Query what I need?

    The answer is 42.

    If that doesn't help you, post some DDL / Sample Data / Expected Results and how you want to manipulate your data to get there.

    Also, having everything...

    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: Need help on performance and integrity

    Although, the only thing I'm also concerned about is the data that has concentrated duplicates like the example below which would affect performance more I guess.

    Due to the nature of...

    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: regd order in output

    [font="Courier New"]SELECT    

       ISNULL(source,'total') Source,

       SUM(CASE WHEN status = 'out' THEN 1 ELSE 0 END) AS out,

       SUM(CASE WHEN status = 'in' THEN 1 ELSE 0 END) AS [in],

       SUM(CASE...

    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: Need help with syntax

    Greg Snidow (10/28/2008)


    Firstly, I am the sole owner of the data, so no one else ever sees it, nor do any reports come from it, nor can anyone else touch...

    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: Need help with syntax

    Greg,

    A couple things. The first question is, how important is this data? I normally try to avoid this type of manipulation, as you are just 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: Need help on performance and integrity

    Ok. For anyone who is reading this thread who is still somewhat confused on how this works, I'm going to attempt to break it down the way I understand...

    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: Need help on performance and integrity

    Oooh. Do me! Do me! (New solution a few posts back.) Despite the cursor, I'd wager that it'd run *fairly* quick. Unless I screwed something...

    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: Help with SELECT and COUNT query

    It looks like if the number of rows retrieved in RateCount is 0 it returns NULL. Is it possible to have the query return "0" if this is the case?

    I...

    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 - 1,216 through 1,230 (of 1,473 total)