Forum Replies Created

Viewing 15 posts - 1 through 15 (of 98 total)

  • RE: Row Number With Repeated Numbers

    Thanks

    Came from the 2005 version, and didnt know this functions...

  • RE: Order When Exists

    Ups...

    I'm getting dumber everyday... :crazy:

  • RE: Order When Exists

    Just add another athlete to the temp table:

    UNION ALL

    SELECT 1,3,'P1',3

    UNION ALL

    SELECT 1,3,'P2',4

    UNION ALL

    SELECT 1,3,'END',7

    UNION ALL

    SELECT 2,3,'P1',1

    UNION ALL

    SELECT 2,3,'P2',3

    UNION ALL

    SELECT 2,3,'END',9

    Then using your code, with the order by

    SELECT ...

  • RE: Order When Exists

    Thanks

    But that doesn't work weel, because the rows must be order by time sofar, and the number 2 will have less time because it haven't completed the second stage...

  • RE: Order When Exists

    The table can be consulted at anytime, in this case the user is looking to it at the end of second stage. So i have only values for the first...

  • RE: Order When Exists

    No, the values were made up... sorry

    With the test data, after stage 2, with a total of 4 stages, should be:

    1 | 10 | 15 | - | - |...

  • RE: Split Multiple Times

    Posted at the end of the day yesterday...

    Thanks everyone for all the replies.

    @Jeff Moden

    Yes, it always have two names separated by sloshes like the serial.

    The question about the position, i...

  • RE: How To Pivot Not Joined Tables

    No...

    So my problem it's that the pivot function needs an aggregate function to work, but what i need it's the current field value...

    In this case it could be anything, some...

  • RE: How To Pivot Not Joined Tables

    In the "beginning" none of the persons will have formation in the jobs list, so the table will be empty...

    When the persons get some kind of training in that job...

  • RE: How To Pivot Not Joined Tables

    So my problem it's that the pivot function needs an aggregate function to work, but what i need it's the current field value...

    In this case it could be anything, some...

  • RE: How To Pivot Not Joined Tables

    By the way, i came with this, but this only count/sums whatever for the column value, i need to get the original value from the possible relation between the tables

    DECLARE...

  • RE: How To Pivot Not Joined Tables

    NULL when there's no relation.

    Here's some sample data:

    IF OBJECT_ID('tempdb..#Person','U') IS NOT NULL

    BEGIN

    DROP TABLE #Person

    DROP TABLE #Job

    DROP TABLE #PersonalJobs

    END

    CREATE TABLE #Person(

    id INT PRIMARY KEY,

    name NVARCHAR(50)

    )

    CREATE TABLE #Job(

    id INT,

    descr NVARCHAR(50)

    )

    CREATE TABLE #PersonJobs(

    idP...

  • RE: Slow Row Number Over Partition

    @Gazareth

    Yes and no.

    Yes, because i need everything, no because i also need to get partitions by the column pf with the row number.

    BTW, there was an error in...

  • RE: Slow Row Number Over Partition

    The time was the main problem here. 🙂

    I decided to make some tests, the tests were in the table with the clustered index as you suggested, the first two with...

Viewing 15 posts - 1 through 15 (of 98 total)