MySQL PHP - Need to display similar records in a table.
Posted on 2010-11-25
I have a large database with:
company_name, username, fax_num, phone_num
I want to select rows that have similar records.
Big Co., bigcomp, 3069335656, 3069335657
Big Co Inc., big, 3069335656, 3069335657
Big Co Inc South., bigco, 3069335650, 3069335657
If these 3 rows were in my table i would want all of them showing. In the instance all 3 have the same phone number. I would like this solution.
I think a group by phone_num where count > 2 or something.
Once I have that solution I think I can modify it to do me similar company_name
`company_name` LIKE "%name%"