I have two tables one for units and one for Amenities
Table units
+---------+---------------------+---------------------+-----------+----------+
| unit_id | date added | date modified | unit name | user |
+---------+---------------------+---------------------+-----------+----------+
| 1 | 2001-10-29 13:11:00 | 2001-10-29 13:11:00 | Villa 1 | Smith |
| 2 | 2001-10-29 13:11:00 | 2001-10-29 13:11:00 | Villa 2 | Smith |
| 3 | 2001-10-29 13:11:00 | 2001-10-29 13:11:00 | Villa 3 | Jones |
| 4 | 2001-10-29 13:11:00 | 2001-10-29 13:11:00 | Apartment | Smith |
+---------+---------------------+---------------------+-----------+----------+
Table Amenities
+---------+-----------+-------------------+
| id | Unit_id | Amenity |
+---------+-----------+-------------------+
| 1 | 1 | Air conditions |
| 2 | 1 | Internet |
| 3 | 1 | Water heaters |
| 4 | 1 | TV |
| 5 | 2 | TV |
| 6 | 2 | pool |
| 7 | 2 | Internet |
| 8 | 3 | Internet |
| 9 | 4 | Internet |
+---------+-----------+-------------------+
i want to select units where it has both TV and Internet
I try
select units.* from units left join Amenities on units.unit_id=Amenities.Unit_id
where Amenities.Amenity='TV' and Amenities.Amenity='Internet'
but not work
Andclause thats y