Forum Replies Created

Viewing 15 posts - 12,226 through 12,240 (of 26,486 total)

  • RE: Delete duplication with where clause condition

    adrian.facio (5/3/2012)


    Ok i read your comment now, then the firts version i wrote is ok, i just allows up steps. I just accepts Single, Married, (Divorced or Widowed). i does...

  • RE: Delete duplication with where clause condition

    adrian.facio (5/3/2012)


    The idea is to order the status changes of a employee chronologically. Now, every status has the "Step Value", if two consetive items are different by 1, then...

  • RE: Sorting Union

    Similar to the above:

    CREATE TABLE dbo.Entries

    (

    entriesID INT IDENTITY(1,1) NOT NULL

    ,name VARCHAR(20) NOT NULL

    ,packageLevel TINYINT NOT NULL

    );

    INSERT INTO dbo.Entries (name,packageLevel) VALUES ('aa',0);

    INSERT INTO dbo.Entries (name,packageLevel) VALUES ('bb',1);

    INSERT INTO dbo.Entries (name,packageLevel) VALUES...

  • RE: Delete duplication with where clause condition

    adrian.facio (5/3/2012)


    I make the following.

    ;WITH CivilStatus (StatusSequenceNumber,[Marital_Status])

    AS

    (

    SELECT 1,'SINGLE' UNION

    SELECT 2,'MARRIED' UNION

    SELECT 3,'DIVORCED' UNION

    SELECT 3,'WIDOWED'

    ),

    PersonCivilStatus

    AS

    (

    SELECT d.empno,d.marital_status,d.status_change_date,

    Sequence = row_number() over (partition by empno order by status_change_date),

    StatusSequenceNumber

    FROM #temp_delete_duplicate d

    INNER JOIN...

  • RE: SQL help to CONCATENATE column values

    ColdCoffee (5/3/2012)


    Schema binding has its own advantages and disadvantages.. But whn u create a view, how ofter do u alter it? You wouldnt right? then i think, schema binding can...

  • RE: String extraction

    komal145 (5/3/2012)


    I would say..it should satisfy the other thread too and also when I was looking at the different strings , they are not satisfying the rules

    1) needed the name...

  • RE: Are the posted questions getting worse?

    SSC is at 1,499,895 and counting!

  • RE: Get counts grouped by time range

    Actually, in my code above, just insert your source table for the derived table in the from clause of the cte I marked for replacement.

    You may have to make some...

  • RE: Get counts grouped by time range

    Here is my solution:

    DECLARE @StartDate DATETIME;

    SET @StartDate = '20111208'; -- Sample start date

    WITH

    e1(n) AS (SELECT 1 UNION ALL SELECT 1 UNION ALL SELECT 1 UNION ALL SELECT 1 UNION ALL...

  • RE: Get counts grouped by time range

    Tony Farrell-305085 (5/3/2012)


    Hi Lynn,

    I am sorry....

    The user will select one day from the interface screen.

    The stored proc will take that date and gather only the logins for that date.

    Breaking the...

  • RE: String extraction

    Now, a question. Do we need to satisfy both the requirements here and the other thread? You had one string in the other thread that you wanted the...

  • RE: String extraction

    komal145 (5/3/2012)


    Hi..it was by me only!!!

    I tried but its not working for the string types mentioned above.

    For future reference, you really should have continued using that thread and expanded on...

  • RE: Get counts grouped by time range

    Just to be sure, my problem is that I'm not sure where to start to help you solve this problem and I need your help to do it. The...

  • RE: Are the posted questions getting worse?

    Grant Fritchey (5/3/2012)


    Sean Lange (5/3/2012)


    Just an observation and a friendly reminder.

    /soapbox on

    We are starting to lean too far to the arrogant side with many of our replies (and yes I...

  • RE: Are the posted questions getting worse?

    SQL Kiwi (5/3/2012)


    Lynn Pettis (5/3/2012)


    SQL Kiwi (5/3/2012)


    One possible test is to imagine one's mother reading the post before hitting 'reply' and wondering if it would make her proud.

    Not trying to...

Viewing 15 posts - 12,226 through 12,240 (of 26,486 total)