Forum Replies Created

Viewing 15 posts - 346 through 360 (of 1,228 total)

  • RE: How to delete the duplicate row without any unique value? please help

    ;WITH OrderedRows AS (

    SELECT Last_Name, First_NAme, Department, Email, phone, Sid,

    rn = ROW_NUMBER() OVER(PARTITION BY Last_Name, First_NAme, Department, Email, phone, Sid ORDER BY (SELECT NULL))

    FROM MyTable

    )

    DELETE FROM...

  • RE: Max or Top 1 more efficient

    How long do they take to run?

    How long does a potentially SARGable SELECT MAX(CONVERT(smalldatetime, CAST(MonthValue AS varchar) + '/01/' +

    ...

  • RE: Help with complicated running balance

    gcresse (4/15/2013)


    I have a challenge that I was hoping to solve using the new SQL Server 2012 running balance capabilities, but it's a bit more complicated than I realized. ...

  • RE: Are the posted questions getting worse?

    SQLRNNR (4/17/2013)


    ChrisM@home (4/17/2013)


    WayneS (4/17/2013)


    Jason

    Congratulations!

    Awesome! Well done Jason!

    Wayne, is that you too?

    Thanks Chris

    And yup Wayne and I received our news on the same day.

    Heh fantastic! That's quite an achievement!

  • RE: Are the posted questions getting worse?

    WayneS (4/17/2013)


    Jason

    Congratulations!

    Awesome! Well done Jason!

    Wayne, is that you too?

  • RE: how to do pivot

    Easier and Correcter 😉

    SELECT [firstname] = value

    FROM test

    WHERE key = 'firstname'

  • RE: How do I use group by on one column which is having many entries?

    ashuthinks (4/17/2013)


    Hi,

    I want to use group by on one column which is having many entries

    table_a

    Name price

    AAA 12

    BBB...

  • RE: Slows system performance

    baabhu (4/17/2013)


    ChrisM@Work (4/15/2013)


    That looks ok to me, other than the joins to the temp table not being optimized. You don't really need the temp table anyway:

    SET @RowsDeleted = 1000;

    WHILE @RowsDeleted...

  • RE: The Cascading (CROSS) APPLY

    Gary Nease (4/16/2013)


    In the initial CREATE TABLE example, [RowNum] should be [EmployeeId].

    Thanks for the great article.

    Thank you very much Gary - duly updated.

  • RE: The Cascading (CROSS) APPLY

    balde (4/16/2013)


    Ever since discovering a use for APPLY for the first time approximately 2 years ago, I've found I use it almost everywhere these days.

    To the extent where I start...

  • RE: I Think This Join Statement is Making Me Crazy(er)

    Is this code generated by a tool?

  • RE: All Possible Combinations Loop

    akberali67 (2/8/2013)


    Finally ran out of system memory after 1.5 hours. I dont know what to do, this stuff is making me crazy.

    Msg 701, Level 17, State 123, Line 3

    There is...

  • RE: All Possible Combinations Loop

    drew.allen (2/8/2013)


    akberali67 (2/8/2013)


    Are Rollup and Cube stored procedures because sql doesnt seem to be recognizing them. I am using SQL Server 2005, maybe thats the problem?

    No, but the syntax was...

  • RE: Turning Scan into Seek...

    GilaMonster (1/29/2013)


    ChrisM@Work (1/29/2013)


    How many rows in the table? How many rows are you returning? If you are returning more than say 25%* of the rows in the table, SQL Server...

  • RE: Help with a query

    Hello and welcome to ssc.

    Your second INNER JOIN condition references the table alias of the first. This should work, assuming suitable values in your data:

    SELECT

    u1.Name AS first,

    u2.Name AS...

Viewing 15 posts - 346 through 360 (of 1,228 total)