Forum Replies Created

Viewing 15 posts - 571 through 585 (of 5,504 total)

  • RE: SQL - Summarising data at different levels

    Did you try using SUM() OVER()?

    SUM(Num) OVER (PARTITION BY Age) AS Ga

    SUM(Num) OVER (PARTITION BY Age, D1) AS GaD1

    SUM(Num) OVER (PARTITION BY Age, D1, D2) AS GaD1D2

  • RE: subquery returning multiple results

    Guessing again, it seems like the OP is quite happy with the answer received at msdn

  • RE: Are the posted questions getting worse?

    Jeff Moden (2/25/2012)


    Returning to the original subject of this thread, I can now say I've seen just about everything on this fine forum.

    http://www.sqlservercentral.com/Forums/Topic1257783-391-1.aspx

    <shudder>

    It becomes rather scary when seen in context...

  • RE: Regarding Writing Stored Procedure

    duplicate post. no replies please. Discussion already started here

  • RE: Help in writing stored procedure

    Please provide table DDL and sample data in a ready to use format as described in the first link in my signature as well as your expceted output based on...

  • RE: CSV Parameter in proc

    I would use a three-step scenario:

    Step1: use the DelimitedSplit8K function referenced in my signature with delimiter ','

    Step2: using the result set, apply the DelimitedSplit8K function with delimiter '='

    Ste3: Use The...

  • RE: subquery returning multiple results

    I'm expecting there's a users table...

    SELECT

    t2.usr,

    SUM (CASE WHEN t1.createdby =t2.usr THEN 1 ELSE 0 END ) AS created,

    SUM (CASE WHEN t1.updatedby =t2.usr THEN 1 ELSE 0 END )...

  • RE: split data of month into weeks

    Another option would be to use a calendar table with the columns you need and join to that table.

    A calender table is especially helpful if there are special date ranges...

  • RE: SQL, VMs, and Backups... Oh my...

    ybz199009 (2/24/2012)


    blabla

    reported as well. There are about 100 of those within the last few hours from the same user. :sick:

  • RE: T-log is failing

    ybz199009 (2/24/2012)


    blabla

    spam. reported.

  • RE: Select XML node with namespaces

    ybz199009 (2/23/2012)


    blabla

    Spam. Reported

  • RE: Select XML node with namespaces

    bcchamberlain (2/23/2012)


    I have tried this code and it works great, but I am having some difficulty with the name spaces. I am trying to get the the submitter name, but...

  • RE: TSQL Help

    I didn't try to convert the numeric value to a date value.

    But here's my approach:

    DECLARE @tbl TABLE

    (

    ROW_NOINT IDENTITY(1,1),

    idINT,

    CHECKS INT,

    duration INT,

    id_date INT

    )

    INSERT INTO @tbl

    VALUES

    (85036024,21504,10,40544),

    (85036024,4337731,10,40545),

    (85036024,269731,10,40548),

    (85036024,269731,10,40549),

    (85036024,269731,10,40552),

    (85036024,21504,10,40553),

    (85036024,21504,10,40554),

    (85036024,21566,10,40555),

    (85036024,21506,10,40556),

    (85036024,21506,10,40557),

    (97393064,21504,11,40558),

    (97393064,21504,10,40562);

    WITH cte AS

    (

    SELECT

    *,

    ROW_NUMBER() OVER(ORDER BY Row_No)-

    ROW_NUMBER()...

  • RE: Will it eat the Performance or not..?

    will it eats the performance

    To answer this question:

    It depends on the code behind the split function. As long as it is not an in-line-table valued function, the answer most...

  • RE: Can you get query plan to WHERE inside a GROUP BY?

    I've been talking about replacing the view with an itvF.

    And yes, you can call the itvF with a parameter that is used inside the function.

Viewing 15 posts - 571 through 585 (of 5,504 total)