Forum Replies Created

Viewing 15 posts - 1,966 through 1,980 (of 5,502 total)

  • RE: To get the Max value from one column with case statement without using any aggregate functions

    nzngh (2/6/2011)


    It was an Interview question, surly I couldn't answer it. I have tried it in any possible way that I know but I got only Null though with two...



    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: Calculating Delta values for each day

    Nicky Murphy (2/6/2011)


    LutzM (2/3/2011)


    That's weird. What is the result of the following statement? It should point to Monday of the current week.

    SELECT DATEADD(WEEK, DATEDIFF(WEEK, 0, GETDATE()), 0)

    SELECT DATEADD(WEEK, DATEDIFF(WEEK, '19000101',...



    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 help with SQL Syntax

    What have you tried so far and where you get stuck?

    In general there are two options: using SSIS or plain T-SQL.

    Basically, the following steps are required:

    Load the file

    Validate data

    Lookup 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: Single PROC / 3 Conditions / Multiple AND's with IF statement

    Yes, it's possible. The statement after IF "is an expression that returns TRUE or FALSE." (straight from BooksOnLine, the SQL Server help system usually installed with SQL Server).

    Another option is...



    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: Calculating Total number of visits

    I would start with two variables holding the start and end month of the period you're looking for.

    Based on that I would build a subquery holding all months within that...



    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: Tuning an DTS

    Duplicate post. No replies please.

    Original post: http://www.sqlservercentral.com/Forums/FindPost1059209.aspx



    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: To get the Max value from one column with case statement without using any aggregate functions

    You could use ROW_NUMBER() OVER(ORDER BY YourColumn DESC) within an CTE and query for Row=1 in an outer SELECT.

    Don't think you'd need the CASE statement for it though...

    But the question...



    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: Logical Problem -> Recursion?

    I'm not fully understand the business case:

    You shipped a quantity X on a given day to more than one customer. Wouldn't you need to know the address of each customer...



    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: Crap Query.... Anyone help tune it in better way

    Please provide table def and sample data as described in the first link in my signature togeteher with your expected result.

    This will help those of us who prefer testing 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: updating a table based on another one

    Beside the required changes due to the unusual column names (I had to wrap it in brackets) the following code did work just fine when I tested it:

    UPDATE X

    SET X.[1ID]...



    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?

    Craig Farrell (2/3/2011)


    ...

    Is it bad that I consider the 'Don't Feed The Trolls' sign a challenge to see if I can manage to piss off a Troll enough to get...



    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?

    Change of subject:

    Anyone of you located in the Chicago area (Jeff?): I hope you folks are all safe and well!!

    The news over here show some rather nasty blizzard effects....

    Take care,...



    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: TSQL: SQL view which shows multiple fields in one field but presented underneath eachother

    My first recommendation: since this is a form of presenting the data, I'd trongly vote for doing it at the presentation layer.

    If that's not an option, you could use T-SQL...



    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: updating a table based on another one

    Asuming X_diff_ID in TableA has a unique constraint, you could join the two tables based on X_diff_ID and update TableX.1ID with TableA.1ID.

    I don't understand the reference to a small table...



    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: Script to loop and relace string

    SELECT *,

    REPLACE(REPLACE(data,'<a href="/back_to_school">',''),'</a>','')

    FROM temp

    WHERE data != ''

    AND data like '%<a href=%'



    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 - 1,966 through 1,980 (of 5,502 total)