Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,
I want to know the query in searching multiple tables in db? I used MySQL database.

Example I have two tables named table1 and table2. If I search some name in table1 if results not found then search in the other table table2. Is this possible?

table: table1
Lname (pk)
Fname
TableNo

table: table2
Lname (pk)
Fname
TableNo

thank you...
Posted
Updated 29-Jul-12 16:39pm
v3

1 solution

I suggest reading some online articles about how SQL works, this is basic stuff.

You use the inner join keywords to join two tables together, you will need a value that is shared between the two. Then you can search for data between tables, but only if they are related to one another.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900