I have two tables in MySQL, customer
and contacts
each row in customer
can have multiple rows in contacts
and contacts.company
will equal customer.sequence
how can i run a query to search both tables and return the results from the customer
table only?
for example, if i have this data:
customer:
sequence = 123
company = Company A
sequence = 321
company = Company B
contacts:
company = 123
forename = John
company = 123
forename = Steve
company = 321
forename = Joe
company = 321
forename = Andy
company = 321
forename = John
and i search for Andy - it should return Company A
If i search for John, it should return Company A
and Company B