search query across different DB tables

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
genux33
Forum Newbie
Posts: 18
Joined: Sun Apr 10, 2005 8:22 am

search query across different DB tables

Post by genux33 »

How should i go about to perform a search query across different tables in the DB.

For example
i had 2 table called individual and student.
Both table contain same field called "email"

how do i build the SQL query that will return the result of email search query.
for example WHERE email = "test@test.com"
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

union is the keyword you need for a websearch. If you are using MySQL you might want to lookup if it is supported for your version..
Post Reply