Results 1 to 3 of 3

Thread: Joining Tables

  1. #1
    Join Date
    Jun 2004

    Unhappy Unanswered: Joining Tables

    I have a table with fields as partnerid, contractno.
    The partnerid field has the Id number which can be a supplier or a customer.
    I need to get the partner id(supplier) and the partner id (customers) of that particular supplier only. I tried with self join but the data is data is replicating.

    Data in table
    PId ContractNo
    20045 1567
    435 1567
    123 1567
    345 1678
    1004 1678

    I need to display the data in the following format.

    PId(Supplier) PId(Customer)
    20045 1567
    20045 435
    20045 123
    345 1678
    345 1004

    But I'm getting the data replicated with all records joined every record.
    Give the suggestion.

  2. #2
    Join Date
    Apr 2004
    Kansas City, MO
    Your data doesn't make sense in any way that would give you the query you want? How do you know which PId is a supplier or Customer? Without some kind of a key to indicate that, there's nothing you can do about your issue.
    When life gives you a lemon, fire the DBA.

  3. #3
    Join Date
    Oct 2003
    Hai Madhavi,
    Can you show us the query that you have written?


Posting Permissions

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