Data filteration

  • Hi experts,

    I have a task which sounds simple to me but as am new in this field i need you guys help

    the task is

    i have a table (A)with 60 coloumns in it which is in sql 2005 which has millions of rows in it

    the data in table (A) is Each Testid has around 5 to 6000 rows

    what my task is i have to create 2 tables (B) , (C) with 30 coloumns in each table and import the relevant data for paticular table from table (A) in to table (B) and (C)

    and they want the distinct(unique) data for each testid the data which is not getting repated but the thing is i have 100 of test id in that table

    for eg test id 123 has 5000 records and test id 456 has 8000 records so for eg testid 123 which has 5000rows out of which 2500 records and and rest 2500 records have diffrent values in each coloum so i want that data with those test id

    so i dont mind having same test id but i want the result for this test id to be diffrent distinct u can say

    Thanks

  • Irfan, with all due respect (and I suppose I am speaking on behalf of many members), your post is not at all clear on what you need to do.

    I grasp the problem of splitting TableA's 60 columns to TableB and TableC with approx 30 columns each (I assume there will be a common PK column). But then you also mention 60 million records, and then "each testid has 5000-6000 records". This (edited quote) is where you lose me:

    [Quote]and they want the distinct(unique) data for each TestID the data which is not getting repeated but the thing is I have hundreds of TestID in that table for eg TestID 123 has 5000 records and TestID 456 has 8000 records so for eg TestID 123 which has 5000 rows out of which 2500 records and rest 2500 records have different values in each column so I want that data with those TestID; I don't mind having the same TestID but I want the result for this TestID to be different (distinct you can say)[/Quote]

    Please clarify.


    Regards,

    goodguy

    Experience is a bad teacher whose exams precede its lessons

  • If I understand correctly you want

    select distinct testid,column1,column2,...column30

    into TableB from TableA

    select distinct testid,column31,column32,...column60

    into TableC from TableA

    This will put rows with unique data in testid and the first 30 columns into tableB and rows with unique data in testid and the last 30 columns into tableC.

    Can't say as I understand the purpose for doing this though.


  • hi mr polecat

    i really appreciate your time basically your are right and good that you understood what they want

    and i know its weird that they want like this am also not clear what exactly their requirement is bcoz this team is in offshore and getting me do some crap work but anyways i guess its right but still i need to be more cleared on this and as soon as i get it i will inform you guys

    Thanks for every one and their time

    you guys really make a diffrence in someone's carreer by helping us

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

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