Forum Replies Created

Viewing 15 posts - 9,811 through 9,825 (of 10,144 total)

  • RE: Need to remove duplicate records and get distinct values

    San (7/16/2008)


    San, do you have any more information regarding this puzzle? For instance, are you aiming to change an existing table to meet your criteria, or to return a satisfactory...

  • RE: Need to remove duplicate records and get distinct values

    San (7/15/2008)


    Hi

    I am sorry if someone has already posted this question and am asking again.

    This problem is eating my head, I have a table

    Table 1 -

    1br

    1er

    2rt

    3yh

    2uj

    3iu

    3ol

    Now I want only...

  • RE: Need to remove duplicate records and get distinct values

    karthikeyan (7/15/2008)


    use distinct keyword

    Interesting solution - care to elaborate?

  • RE: Database Design for Online Examination System

    vasaharshit (7/11/2008)


    hi all,

    Please help me out to design the database for online examination system.

    You will need to provide much more...

  • RE: Convert 3X2 rows,columns to 1X6 row.columns

    Something like this?

    CREATE TABLE #ContactDetails (ContactID INT, ContactMethod VARCHAR(5), ContactDetail VARCHAR(30))

    INSERT INTO #ContactDetails (ContactID, ContactMethod, ContactDetail)

    SELECT 1, 'Phone', '+1 413 2220144' UNION ALL

    SELECT 1, 'Fax', '+1 413 2221144'...

  • RE: eliminating duplicates

    harshil (7/8/2008)


    Hi Jeff, In this query, the condition is rightly mentioned as rowno>1 and shouldn't be rowno=1

    What the purpose of this query is to remove all duplicate records except one...

  • RE: eliminating duplicates

    harshil (7/8/2008)


    Yes Mr. Actually I have read the requirements and I have correctly suggested the intended solution to delete duplicate records.

    Although I have intentionally mentioned it for SQL SERVER...

  • RE: Getting the Last Integer values

    DECLARE @t nvarchar(16)

    SET @t = 'T5e3st003'

    SELECT RIGHT(@t, MIN(number)-1)

    FROM Numbers

    WHERE SUBSTRING(REVERSE(@t), number, 1) NOT IN ('1','2','3','4','5','6','7','8','9','0')

    AND number < 10

    DROP TABLE #test

    CREATE TABLE #test (t nvarchar(16))

    INSERT INTO #test (t)

    SELECT 'T5e3st003'...

  • RE: Getting the Last Integer values

    A single statement?

    SET @T = '03' 😉

    Or perhaps

    SET @T = REVERSE(LEFT(REVERSE(@T),2))

    Or even

    SET @T = substring(@T, 6, 2)

    All of these (and Gail's solution) will give the result "03". Is...

  • RE: The Daily Commute

    Two hours & three trains each way: Reading -> Virginia Water -> Weybridge -> Surbiton (Reading -> Basingstoke -> Surbiton as backup route). WFH two days a week so it...

  • RE: Help Optimizing Query?

    pop (7/1/2008)


    Interesting, def a little shorter code-wise....no performance increase though...

    How many rows are returned by this...

    SELECT a.casenum, a.at_id

    FROM #audit_trail a

    INNER JOIN (SELECT MAX(at_id) AS at_id, casenum FROM...

  • RE: eliminating duplicates

    d_sysuk (7/2/2008)


    Hi Saritha,

    Think you may have made the first initial mistake that I did, (whilst was determining what the poster required - as was not the clearest)..

    Background

    Table: Has dup rows

    Requirement:

    Delete...

  • RE: eliminating duplicates

    saritha (7/2/2008)


    Try this

    set rowcount 1

    select 1

    while @@rowcount > 0

    delete Emp1 where 1 < (select count(*) from Emp1 a2

    where Emp1.Eno = a2.Eno

    ...

  • RE: eliminating duplicates

    karthikeyan (7/2/2008)


    Jeff,

    Heh... this all reminds me of another of my favorite 4 letter acronyms... RTFS!!!!!

    what do you mean by RTFS ?

    Read the friggin' spec 😛

  • RE: eliminating duplicates

    rbarryyoung (7/1/2008)


    Though don't forget that you need a covering Clustered Index to make this work.

    Thanks for pointing that out Barry. This solution will only work if the data is ordered...

Viewing 15 posts - 9,811 through 9,825 (of 10,144 total)