Forum Replies Created

Viewing 15 posts - 1,006 through 1,020 (of 1,251 total)

  • RE: display all data from row 1 but include sum total of all rows amount column in data set

    You're welcome.

    If you have read of this article [/url] then it'll be much quicker getting an answer in future. It'll save people having to make assumptions and it'll...


    On two occasions I have been asked, "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" ... I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
    —Charles Babbage, Passages from the Life of a Philosopher

    How to post a question to get the most help http://www.sqlservercentral.com/articles/Best+Practices/61537

  • RE: display all data from row 1 but include sum total of all rows amount column in data set

    You can use one CTE after another, like so:

    CREATE TABLE #Question ([Description] VARCHAR(15), [Amount] INT)

    INSERT INTO#Question

    SELECT 'Bob', 10 UNION ALL

    SELECT 'Tim',20 UNION ALL

    SELECT 'Jim',30

    ;

    WITH cteTest AS

    (

    SELECT * FROM...


    On two occasions I have been asked, "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" ... I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
    —Charles Babbage, Passages from the Life of a Philosopher

    How to post a question to get the most help http://www.sqlservercentral.com/articles/Best+Practices/61537

  • RE: display all data from row 1 but include sum total of all rows amount column in data set

    Rhythmk's solution does exactly what you want or the alteration to my solution below will do the same, although much less elegantly.

    SELECT

    q.[Description]

    ,SUM(s.totSum)

    FROM #Question q

    CROSS APPLY

    (

    ...


    On two occasions I have been asked, "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" ... I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
    —Charles Babbage, Passages from the Life of a Philosopher

    How to post a question to get the most help http://www.sqlservercentral.com/articles/Best+Practices/61537

  • RE: display all data from row 1 but include sum total of all rows amount column in data set

    I see, so you want whatever is the first description value to be the description that is displayed.

    How is the ordering done? Is it done on the value of the...


    On two occasions I have been asked, "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" ... I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
    —Charles Babbage, Passages from the Life of a Philosopher

    How to post a question to get the most help http://www.sqlservercentral.com/articles/Best+Practices/61537

  • RE: No Files For You

    John Mitchell-245523 (6/18/2014)


    Ed Wagner (6/18/2014)


    On site means on site, not Azure - plain and simple.

    Precisely. All on-site databases are 2012, meaning 2000 can't be the answer. And since...


    On two occasions I have been asked, "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" ... I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
    —Charles Babbage, Passages from the Life of a Philosopher

    How to post a question to get the most help http://www.sqlservercentral.com/articles/Best+Practices/61537

  • RE: display all data from row 1 but include sum total of all rows amount column in data set

    CREATE TABLE #Question ([Description] VARCHAR(15), [Amount] INT)

    INSERT INTO#Question

    SELECT 'Bob', 10 UNION ALL

    SELECT 'Tim',20 UNION ALL

    SELECT 'Jim',30

    SELECT

    [desc] =q.[Description]

    ,amt = SUM(s.totSum)

    FROM #Question q

    CROSS APPLY

    (

    SELECT

    totSum...


    On two occasions I have been asked, "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" ... I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
    —Charles Babbage, Passages from the Life of a Philosopher

    How to post a question to get the most help http://www.sqlservercentral.com/articles/Best+Practices/61537

  • RE: No Files For You

    GilaMonster (6/18/2014)


    Koen Verbeeck (6/18/2014)


    The answer is incorrect.

    The question clearly states that the databases are on site. Thus, by the process of elimination, the corruption answer is the only one left.

    Except...


    On two occasions I have been asked, "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" ... I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
    —Charles Babbage, Passages from the Life of a Philosopher

    How to post a question to get the most help http://www.sqlservercentral.com/articles/Best+Practices/61537

  • RE: No Files For You

    Toreador (6/18/2014)


    You are working for a company that has uses SQL 2012 for their on site databases. A fellow DBA is trying to do a quick check on a database...


    On two occasions I have been asked, "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" ... I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
    —Charles Babbage, Passages from the Life of a Philosopher

    How to post a question to get the most help http://www.sqlservercentral.com/articles/Best+Practices/61537

  • RE: No Files For You

    Koen Verbeeck (6/18/2014)


    BWFC (6/18/2014)


    Koen Verbeeck (6/18/2014)


    BWFC (6/18/2014)


    You are working for a company that has uses SQL 2012 for their on site databases.

    This explicitly rules out that the databases are...


    On two occasions I have been asked, "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" ... I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
    —Charles Babbage, Passages from the Life of a Philosopher

    How to post a question to get the most help http://www.sqlservercentral.com/articles/Best+Practices/61537

  • RE: No Files For You

    Koen Verbeeck (6/18/2014)


    BWFC (6/18/2014)


    You are working for a company that has uses SQL 2012 for their on site databases.

    This explicitly rules out that the databases are in the cloud,...


    On two occasions I have been asked, "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" ... I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
    —Charles Babbage, Passages from the Life of a Philosopher

    How to post a question to get the most help http://www.sqlservercentral.com/articles/Best+Practices/61537

  • RE: No Files For You

    You are working for a company that has uses SQL 2012 for their on site databases.

    This explicitly rules out that the databases are in the cloud, the answer to...


    On two occasions I have been asked, "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" ... I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
    —Charles Babbage, Passages from the Life of a Philosopher

    How to post a question to get the most help http://www.sqlservercentral.com/articles/Best+Practices/61537

  • RE: CTE DML

    rhythmk (6/17/2014)


    BWFC (6/17/2014)


    rhythmk (6/17/2014)


    Thanks for question.It reminds me the trick to delete the duplicate records in a table 🙂

    Could you enlighten me on that please? It sounds very useful.

    Here...


    On two occasions I have been asked, "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" ... I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
    —Charles Babbage, Passages from the Life of a Philosopher

    How to post a question to get the most help http://www.sqlservercentral.com/articles/Best+Practices/61537

  • RE: Order of the result issue in T-SQL

    How is the order you want being decided? They appear essentially random to me.


    On two occasions I have been asked, "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" ... I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
    —Charles Babbage, Passages from the Life of a Philosopher

    How to post a question to get the most help http://www.sqlservercentral.com/articles/Best+Practices/61537

  • RE: Date format conversion

    What Koen said.

    Yesterday I was wondering why we had some call data with a 1753 date on it. I thought it was our problem until I looked up that.

    Edited...


    On two occasions I have been asked, "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" ... I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
    —Charles Babbage, Passages from the Life of a Philosopher

    How to post a question to get the most help http://www.sqlservercentral.com/articles/Best+Practices/61537

  • RE: View read only acess

    If you read this article it should point you in the right direction. It will be almost impossible to write the exact query you need from the...


    On two occasions I have been asked, "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" ... I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
    —Charles Babbage, Passages from the Life of a Philosopher

    How to post a question to get the most help http://www.sqlservercentral.com/articles/Best+Practices/61537

Viewing 15 posts - 1,006 through 1,020 (of 1,251 total)