0

Hello everyone. I am new in coding and db so i am facing a problem regarding of fetching the data from 3 tables. Please suggest or help me. Thanks in advance.

I was writing a query to fetch data from 4 tables i.e pat_table, test_table, doc_table, emp_table.
In pat_table there are columns tid, did, eid. Tid from test_table, did from doc_table and eid from emp_table.

Problem: when i am using join the data is fetching but if the pat_table contains one record then that record is displaying 10 times.

Please help me with this.

Thanks...!!!

2
Contributors
2
Replies
3
Views
4 Years
Discussion Span
Last Post by onlineboy18
0

Try this sql code, it might help.

SELECT pt.tid, pt.did, pt.eid FROM pat_table
INNER JOIN test_table tt on tt.tid = pt.tid
INNER JOIN doc_table dt on dt.did = pt.did
INNER JOIN emp_table et on et.did = pt.did
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.