why you are using view? if the People_contacts
and Activities_contacts
are exactly the same, you can try this:
create view `test` as select *,'People' as Type from `People_contacts` union select *,'Activities' from `Activities _contacts` union;
and then select what you want from the view:
select * from `test` where Type = 'People' and .....
and your query answer should be this
+----+------+ +--------+
| ID | Data |...| Type |
+----+------+ +--------+
| 1 | foo |...| People |
| 2 | foo |...| People |
+----+------+ +--------+