Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Joining Keys

Status
Not open for further replies.

ndog4ever

MIS
Feb 6, 2002
92
US
I am trying to design a database with multiple tables. I want to have a primary key in one of my tables point to the primary key of another.
Example routers.serial3_dlci21.system, something along those lines, where system is the database, and routers is the general table with general info, and serial3 contains all the specific customer info for that interface. Any help would be greatly appreciated because I am very new to MySql.

Thanks

 
select r.field1,r.field2,s.field3,s.field4 from routers r,serial s WHERE r.name = s.name;

This links the tables by the common field "name" the join is achieved by aliasing the tables r and s and prepending th efield names i.e. r.name = the field "name" table routers.

i think thats clearish ;-) ***************************************
Party on, dudes!
[cannon]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top