I have 4 tables all with the same primary key with structure like :
table_1 : u_id | col1 | col2
table_2 : u_id | col3 | col4
table_3 : u_id | col5 | col6
table_4 : u_id | col7 | col8
I want to fetch the data of "col1", "col4", "col6" and "col7" on the basis of the value of u_id.
Values of u_id are same in every table.
For eg. if u_id='8', then fetch all the specified column values where u_id='8'.
I am not using joins correctly, i guess.
Thanks.
This should be pretty straight forward. Use
INNER JOINTo learn more about joins, please see the article below.