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
MySQL Server

Avatar of undefined
Last Comment
OmniUnlimited

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
PranjalShah

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
OmniUnlimited

SELECT `website` FROM `data` WHERE `company` LIKE '1' OR `company` LIKE '2' OR `company` LIKE '3' LIMIT 5;
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck