-3

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?

Alon Eitan
  • 11,997
  • 8
  • 49
  • 58
ATUL PATIL
  • 21
  • 3

1 Answers1

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