Hello
Here are two tables that have a different structure.
TABLES | FIELDS
table1 : t1_ID, ID_of_t2, f1, f2
table2 : t2_ID, f3, f4
While simply retrieving all the data from table1 without using a WHERE clause, how could I make mySQL retrieve f3 and f4 accordingly to ID_of_t2 being equal to t2_ID?
Is a single query possible in that case?
Until now, I've always done a sub-query inside the loop of the main query which caused as many queries as the number of rows. Not very professional isn't it
Although I've read the documentation many times, I doubt that what I want to achieve has anything to do with a Join clause.
Many many thanks to the ones who will have an idea.
Have a nice day.
Here are two tables that have a different structure.
TABLES | FIELDS
table1 : t1_ID, ID_of_t2, f1, f2
table2 : t2_ID, f3, f4
While simply retrieving all the data from table1 without using a WHERE clause, how could I make mySQL retrieve f3 and f4 accordingly to ID_of_t2 being equal to t2_ID?
Is a single query possible in that case?
Until now, I've always done a sub-query inside the loop of the main query which caused as many queries as the number of rows. Not very professional isn't it
Although I've read the documentation many times, I doubt that what I want to achieve has anything to do with a Join clause.
Many many thanks to the ones who will have an idea.
Have a nice day.