Forum Replies Created

Viewing 15 posts - 1,066 through 1,080 (of 1,473 total)

  • RE: Stock Ledger - Without cursor

    Please refer to the link in my signature for an example of how to post table DDL / Sample Data here. Once we have that, we can get you...

    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: Bypassing the keyword DISTINCT

    Indeed. The problem at the moment is that I don't really understand how to read execution plans / see the specifics of which might be better for what reason....

    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: To case or not case

    Oops, I was misreading it, I kept thinking he wanted the extra space to show the missing value. In that case:

    [font="Courier New"]

    DECLARE @A VARCHAR(10),

       @b-2 VARCHAR(10),

       @C VARCHAR(10),

       @d...

    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: To case or not case

    Why can't you just use a space as your replacement instead of an emty string?

    [font="Courier New"]DECLARE @A VARCHAR(10),

       @b-2 VARCHAR(10),

       @C VARCHAR(10),

       @d VARCHAR(10),

       @E VARCHAR(10),

       @f VARCHAR(10),

       @Combined VARCHAR(20)

    SET...

    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: Bypassing the keyword DISTINCT

    GilaMonster (11/20/2008)


    It's not only not beneficial, it can be harmful.

    Duplicates in an IN are ignored. All that's important to the IN is what values exist, not how many times...

    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: Bypassing the keyword DISTINCT

    Makes sense. That said, I've read that in certain circumstances, such as IN clauses, it's usually beneficial to add DISTINCT, even if you shouldn't really need it. Not...

    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 to Write one select CURSOR who sum one field in the last recno and put it one actual recno on selected field.

    Hi.. I donΒ΄t need exactly the value as you sample in your query

    SELECT '2008-11-17',569512.00 UNION all

    SELECT '2008-11-17',966786.00 UNION all

    SELECT '2008-11-17',465119.00

    I need the value of this field subtract from...

    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: Bypassing the keyword DISTINCT

    Can you make this join 1 to 1 ? b.BRL_ID = d.BRL_ID

    Where did you read that DISTINCT had a high cost associated with 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: Help to Write one select CURSOR who sum one field in the last recno and put it one actual recno on selected field.

    Please refer to the link in my signature for how to post table definition / sample data here.

    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: conditional if statements

    I'm thinking something like this should also work... assuming username is enforced unique.

    [font="Courier New"]UPDATE @AppUsers

    SET    UserName = COALESCE(@NewUserName, UserName),

                Classification = COALESCE(@NewClassification,Classification),

                Merchant = COALESCE(@NewMerchant,Merchant)

        WHERE UserName = @OldUserName[/font]

    The quirk of this method is...

    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: Update using concatination

    You were actually really close. The error likely comes from the double quotes instead of single quotes. What does this give you?

    --UPDATE [StarcalClone].[StarCal].[tbl_user]

    SELECT [starcalclone].[StarCal].[tbl_user].[s_name], CP.[last_first_name], *

    --SET ...

    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: Process blocking itself .. help !

    If RedundantData is constantly being written to, you could possibly have some issues with extra rows being deleted in the second or third delete statements that weren't deleted out 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: Process blocking itself .. help !

    Instead of:

    declare @id varchar (10)

    declare id_cur cursor for

    select id

    from redundantdata

    open id_cur

    fetch next from...

    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 modifying a free text "condition" column.

    I don't really understand how that's going to work better than the method I proposed. Don't get me wrong, it doesn't bother me that you're going a different route,...

    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 display 3 columns from different table into one query

    Please read the article in my signature on how to post table definition / sample data here. This could be very simple or somewhat difficult depending on the structure...

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