Forum Replies Created

Viewing 15 posts - 2,041 through 2,055 (of 5,502 total)

  • RE: Date range query slow on a date as varchar

    In that case I would declare the variables as varchar instead of datetime.



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Date range query slow on a date as varchar

    It's most probably because of implicit conversion.

    All your data will be converted internally to datetime when using the variables, since the datetime datatype has a higher precedence.

    The two queries cannot...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Are the posted questions getting worse?

    bitbucket-25253 (1/21/2011)


    ...

    Having worked in Mexico city, waiting on a shipment of tools from the U.S. and the clerk who told us just about what you experienced,was in the customs office.

    We...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Avoid cursor for multiple columns and multiple variables

    Did you measure the time to declare the cursor and to determine the value of @Proposal vs. actually processing the rows?

    I'm not sure if those two together with the rest...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Using group by with multiple fields

    Depending on your required output

    Select BL_ID,

    sum(D.FRT_USD) as FRT_USD,

    TEU,

    SAISAN_MONTH

    from tablename

    group by BL_ID,TEU,SAISAN_MONTH

    Or

    Select BL_ID,

    sum(D.FRT_USD) as FRT_USD,

    MIN(TEU) as Min_TEU,

    MIN(SAISAN_MONTH) AS Min_SAISAN_MONTH

    from tablename

    group by BL_ID

    Or there might be the need of a subquery. It...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Are the posted questions getting worse?

    GilaMonster (1/21/2011)


    ...

    Yes, and I got a second meeting invite for Monday afternoon. Accepted that cause I just don't feel like fighting any more.

    Unfortunately, a term like "mañana" seems not to...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: sql queries

    please read and follow the instructions given in the first link in my signature.

    You might also search either this site or Google for a solution. This is a rather common...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: A different Type Of Query

    GSquared (1/21/2011)


    ...

    There are multiple means of physically implementing row uniqueness. But "the primary key" != "primary key constraint". You have a set of columns that uniquely identify the...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Installing Analysis and Integration services On Virtual server

    It might help others if you'd include at least a reference to your other post and explain the different/additional requirement...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: help loop through rows to expand (date, number of months) to multiple rows

    Glad I could help.

    And I agree, the tally table article is a helpful read. But if you're actually start using the concept, it becomes a powerful tool.



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Need to Column4 value as Column4 and Column5

    Did you actually read the article and try to follow the concept behind it?

    Here's the crosstab version for your scenario.

    SELECT

    i,

    p,

    MAX(status) AS status,

    MAX(CASE WHEN status='T' THEN amt ELSE 0 END)...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Need to Column4 value as Column4 and Column5

    parthi-1705 (1/20/2011)


    Hi

    I dont think so Cross tab will help here since i dont want data in horizontal or vertical i need just to add one column (Need Column4...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: help loop through rows to expand (date, number of months) to multiple rows

    CROSS APPLY together with some sort of a tally table should help here.

    If you're not using a tally table yet, I recommend reading the article referenced in my signature.

    DECLARE @tbl...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Need to Column4 value as Column4 and Column5

    I see your point. Therefore I think using the CrossTab method would help here.

    So I recommended to read about it and give it a try. 😉



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: A different Type Of Query

    GSquared (1/20/2011)


    ...

    You can create a table that doesn't have a Primary Key constraint, but if it doesn't actually have any set of columns that uniquely identify the rows, then it's...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

Viewing 15 posts - 2,041 through 2,055 (of 5,502 total)