Skip to content
Advertisement

mysql count from table where related record exist in other table

I have 2 tables, customers and addresses. I want to count how many customers have addresses with name like a given search term

something like

Table Customers

Table address


Advertisement

Answer

You can use a inner join to connect both tables

This wouldm show how many addresses c.name has

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement