Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)

  • Reply To: Working with T-SQL function AVG ()

    A major use case missed is use of the OVER clause:

     

    select

    id,

    name,

    designation,

    Salary,

    AVG(salary) over (partition by designation) Avg_Sal

    from [dbo].[Associates]

    would yield the entire list, along with the average salary for all with the...

  • Reply To: Zero or Hero?

    What is more interesting is that

    IF (1 <> 1)

    BEGIN

    DECLARE @NumOfHolidays INT;

    SET @NumOfHolidays = 0;

    END

    SELECT @NumOfHolidays;

    returns null, not an error

     

Viewing 2 posts - 1 through 2 (of 2 total)