For Example, I have 2 tables first table has custid,custname and second table has custid,cust multiple mobile numbers......I want to print custname and cust mobile numbers using custid then what will be my sql query?
Asked
Active
Viewed 658 times
-3
-
2Please read [ask] and create a [mcve] – Alon Eitan Dec 25 '18 at 18:56
-
Hint: `...INNER JOIN ... ON
.custid = – Raymond Nijland Dec 25 '18 at 19:01.custid ...` or `... INNER JOIN ... USING(custid) ...`
1 Answers
1
You need to apply JOINS in multiple table relationship. A simple example is a user and yours phones:
TABLE USER : usr_id, attributes... TABLE PHONE : phn_id, attributes, fk_usr_id
a query to view the phones of the user:
SELECT * FROM user as usr
INNER JOIN phone as phn ON phn.fk_usr_id = usr.usr_id
All of this in the documentation. Greats

Nicolas Santos
- 64
- 1
- 5