Results 1 to 2 of 2

Thread: Unresolve problem!

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2000
    Location
    jerusalem
    Posts
    72

    Unresolve problem!

    Hi!
    I have some tables in my database.
    I want to know how can I indentify the column that contains
    the primary/foreign key for example:
    I have 2 tables, one called "employers" that has 2 columns:
    Emp_Id and name, and the other table called "salary" and to this table there are several columns that one of them is Emp_Id.
    I'm looking for a function that returns the salary table and
    the Emp_Id column and the employers table.
    (maybe OpenSchema function?)
    Thank you
    Last edited by royi; Aug 21st, 2001 at 06:50 AM.

  2. #2
    Addicted Member
    Join Date
    Mar 2001
    Posts
    157
    The SQL statement you need is:

    "SELECT employers.* , salary.* FROM employers INNER JOIN salary ON employers.EmpID = salary.EmpID"

    or if you have the EmpID and just want to find 1 matching record:

    "SELECT employers.* , salary.* FROM employers INNER JOIN salary ON employers.EmpID = salary.EmpID WHERE employers.EmpID =" & IDToLookFor

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