CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Logic Neede

  1. #1
    Join Date
    Oct 2005
    Location
    India
    Posts
    24

    Exclamation Logic Neede

    Hi all,

    I am having A TABLE with datas like
    I II
    --------
    10-50
    11-50
    11-70
    50-75


    I have to derive all the possible combinations for duplicates.for ex 50 gets repeated for 1 ,2 and 4the row.Now 10,11,75 are duplicates.Can anybody give me an idea how to implement this logic.

  2. #2
    Join Date
    Oct 2005
    Posts
    28

    Re: Logic Neede

    How about something like:

    Code:
    create table CompareTable
    (CompareField DataType,
    FromField DataType)
    Code:
    Insert into CompareTable (CompareField, FromField)
    values (FirstTable.Field1, "Column1")
    from FirstTable
    Code:
    Insert into CompareTable (CompareField, FromField)
    values (FirstTable.Field2, "Column2")
    from FirstTable
    Code:
    select CompareField, Count(*)
    from CompareTable
    group by CompareField

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured