I always have trouble with this concept when referencing ID's in a database and I was wondering if anybody had any feedback.
If I have the following 2 tables:
table DB_RECORDS has columns ID (int),Name (varchar 25),State_ID (int)
table DB_STATES has columns State_ID (int),State_Name (varchar 30)
When running a query listing out DB_RECORDS is there an efficent way to print out the "State_Name" by referencing the State_ID without running a separate query for each DB_RECORDS result returned? I guess what I am trying to do is reference by ID between 2 tables...
Any insight would be appreciated.
Thanks,
Eric
Eric
If I have the following 2 tables:
table DB_RECORDS has columns ID (int),Name (varchar 25),State_ID (int)
table DB_STATES has columns State_ID (int),State_Name (varchar 30)
When running a query listing out DB_RECORDS is there an efficent way to print out the "State_Name" by referencing the State_ID without running a separate query for each DB_RECORDS result returned? I guess what I am trying to do is reference by ID between 2 tables...
Any insight would be appreciated.
Thanks,
Eric
Eric