I have two tables, company and openhours.
company id | name
openhours id | day | company | open | close
openhours has 7 rows per company, with each days open hours ('mon', 'tue', 'wed' etc)
Basically I want to fetch the openhours for both wednesday (wed) and thursday (thu)
SELECT * FROM openhours WHERE company=1 AND day='wed'
SELECT * FROM openhours WHERE company=1 AND day='thu'
What I'm looking for though is getting both the company and openhours for the company in the same query, but so far I can only get 1 row for openhours
SELECT company.*, openhours.* FROM company INNER JOIN openhours ON openhours.company=company.id WHERE openhours.day == 'wed' OR openhours.day == 'thu
Any help? Been sitting on this for quite some time now
EDIT This is how the openhours table looks like (company id 1)
id | day | company | open | close
1 mon 1 08:00 16:00
2 tue 1 08:00 16:00
3 wed 1 10:00 16:00
4 thu 1 11:00 15:00
5 fri 1 08:00 16:00
6 sat 1 11:00 14:00
7 sun 1 11:00 14:00