MySQL – Workbench (PHP):
Is it possible to link multiple tables in a relational database without using the JOIN, or INNER JOIN query commands, without duplicating data in tables?
For instance I have two tables with collumns:
-
TUsers (Related to TCompanies,1-n)
- ID_TUsers (UNIQUE ID)
- TUsers_UserName
- TUSers_UserContactNumber
-
TCompanies
- ID_TCompanies (UNIQUE ID)
- TCompanies_CompanyName
- TCompanies_CompanyContactNumber
In essence; I want to access COMPANY data from the USERS table without doing a JOIN query between the two tables…
It depends what you are trying to do, you can use a where clause but you don’t seem to have any fields which indicate a join between the two tables. Is there a foreign key in either of the two tables?
Since you now mention you have a
TUsers_CompanyIDin theTUserstable you can do the following: