Forum Replies Created

Viewing 15 posts - 196 through 210 (of 516 total)

  • RE: Data Page Allocations

    Nice question Sean. Thanks for reminding the basics!

  • RE: Divide by zero

    Nice question and a good discussion indeed!

  • RE: Santa's List

    Happy Holidays to all 🙂

    Cheers

  • RE: Aggregates in T-SQL

    demonfox (12/21/2012)


    Well Said Lokesh !!

    Here a reference and statement for learning

    1. COUNT(*) returns the number of items in a group. This includes NULL values and duplicates.

    2. COUNT(ALL expression) evaluates...

  • RE: Aggregates in T-SQL

    Yggaz (12/21/2012)


    Lokesh Vij (12/21/2012)

    I do not agree with this. COUNT(*) only considers counting the number of rows. It does not even bother to take a look at the columns and...

  • RE: Aggregates in T-SQL

    Yggaz (12/21/2012)


    There is just one variant of one aggregate function that DOES take nulls into account: COUNT(*).

    However, it is uncompatible with DISTINCT clause.

    SELECT COUNT(col1) as cnt_col1

    ...

  • RE: help!!! calculate average rolling 4 last weeks

    vinu512 (12/20/2012)


    Are you executing the same script that I posted??.....It seems to work perfectly on my box and I think on Cadavre's box as well.

    I think your script is fine!

  • RE: help!!! calculate average rolling 4 last weeks

    Cadavre (12/20/2012)


    So I guess my advice is to always post sample data and expected results in the future. But for this problem, you need to figure out whether any of...

  • RE: help!!! calculate average rolling 4 last weeks

    Lidou123 (12/20/2012)


    Hi Lokesh,

    that works well with index .

    Thank U !!!!!!!!!

    Gald that you found out a way to improve the query using an Index 🙂

  • RE: Aggregates in T-SQL

    Good Question!

    And very rightly pointed out in the explanation that aggregate functions does not take NULL values into account. This is the reason you get the following warning when using...

  • RE: UNIQUE constraint

    SQLRNNR (12/20/2012)


    Stewart "Arturius" Campbell (12/20/2012)


    IMHO, I think the correct answer here will be "It depends".

    It depends on whether filtered indexes are utilised or not, etc.

    However, it could be that...

  • RE: help!!! calculate average rolling 4 last weeks

    Here you go..

    -- Creating table

    CREATE TABLE year_week_value

    (

    year INT,

    week INT,

    value INT

    ...

  • RE: UNIQUE constraint

    Yggaz (12/19/2012)


    Lokesh Vij (12/19/2012) Ideally, both Unique constraint and Unique index are same as Unique Constraint creates Unique Index to maintain the constraint to prevent duplicate keys.

    They are definitely not....

  • RE: UNIQUE constraint

    I am sorry to say, looking at the correct answer, the question seems to be confusing! The question should have mentioned "Unique Index" instead of "Unique Constraint". Ideally, both Unique...

  • RE: What will the max id be?

    palotaiarpad (12/19/2012)


    For me is a possible source of inconsitency.

    Not sure why you said this as "inconsistency"...it's just the property of TRUNCATE command!

Viewing 15 posts - 196 through 210 (of 516 total)