|
-
Aug 21st, 2001, 05:28 AM
#1
Thread Starter
Lively Member
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.
-
Aug 21st, 2001, 09:43 AM
#2
Addicted Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|