Link to home
Start Free TrialLog in
Avatar of instant99
instant99

asked on

php my admin mysql query

How do i write a query that combines all these into one result
SELECT `website` FROM `data` WHERE `company` LIKE '1' LIMIT 5;
SELECT `website` FROM `data` WHERE `company` LIKE '2' LIMIT 5;
SELECT `website` FROM `data` WHERE `company` LIKE '3 LIMIT 5;

I want to get back 5 records for each company name 1,2 and 3
the resulting recordset should be 15

im sure the easy answer is to write this in php but i prefer to do a mysql query that brings me back the 15 rows
ASKER CERTIFIED SOLUTION
Avatar of PranjalShah
PranjalShah
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SELECT `website` FROM `data` WHERE `company` LIKE '1' OR `company` LIKE '2' OR `company` LIKE '3' LIMIT 5;