1.
select person.cid,person.pname,person.fname,person.lname,village.village_moo,village.village_name
from (person join village on (person.village_id=village.village_id) )
where cid in (select cid from person group by cid
having count(cid)>1) and village.village_moo <>0 order by cid ASC;
2.
select person.cid,person.pname,person.fname,person.lname,village.village_moo,village.village_name
from (person join village on (person.village_id=village.village_id) )
where fname in (select fname from person group by fname
having count(fname)>1) and village.village_moo <>0 order by fname ASC;
ปล.
เป็นการทดสอบ CPU ของ Server ไปในตัว