delete the columns

  • india,1,987

    unitedstates,2,987

    uk,1,723

    australia,2,723

    pakistan,3,723

    i have file like this, after reading it from the flatfile source i have 3 colums

    NAME,SUB-SEQNO,Serial No

    i need

    unitedstates,2,987

    pakistan,3,723

    i mean the latest ones should be there in the destination columns.

    can anyone help me with this

    how to solve this?

  • i mean the latest ones should be there in the destination columns

    What defines the latest ones?

    Is it the column SUB-SEQNO value

    or

    Serial No values

    or

    some combination of SUB-SEQNO values and Serial No value

    and what T-SQL code did you attempt to use to do this?

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • india,1,987

    unitedstates,2,987

    uk,1,723

    australia,2,723

    pakistan,3,723

    if you look at the above data, i need the last record in that serial no

    like

    india, 1 , 987

    unitedstates, 2 , 987

    so according to above discussion i need unitedstates,2,987

    uk,1,723

    australia,2,723

    pakistan,3,723

    for this i need pakistan,3,723.

  • its like our script component look for the serial no then look for the subseq no then output the highest subseqno row of that serial number.

    Please help me out

  • Try this:

    SELECT Name, MAX(Subsqno),SerialNo FROM TbL01 GROUP BY NAME,SerialNo HAVING COUNT(Name) = 1

    UNION

    SELECT Name, MAX(Subsqno), SerialNo FROM TbL01 GROUP BY NAME,SerialNo HAVING COUNT(Name) > 1

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply