SELECT *, COUNT(*) as C
FROM table1
GROUP BY (id)
HAVING COUNT(country)>1 AND COUNT(name)>1 select a.*, b.*
from a
join b on a.b_id=b.id
where b.whatever_id in(10,15,20)select a.*, b.*
from a
join b on a.b_id=b.id and b.whatever_id in(10,15,20)SELECT
t1.id AS id,
t1.number as number,
t2.first_name as name,
t2.last_name as surname
FROM
table1 t1
JOIN table2 t2 ON t1.country = t2.country
WHERE
t1.country = 'Mexico'number надо будет заключить в кавычки. `number` для MySQL или "number" для PostgreSQL