我有两个表 rooms
和 rooms facilities
,我必须选择与所需设施的房间。
如果我选择一个有一个设施的房间(id = 4-id _ fu-的设施)。使用以下查询:
SELECT u.* FROM rooms u
JOIN facilities_r fu
ON fu.id_uc = u.id_uc
AND fu.id_fu = '4'
WHERE 1
AND vizibility='1'
GROUP BY id_uc
ORDER BY u_premium desc, id_uc DESC
But if I want to select the room with more facilities, let's say facilities with id=4, and id=3 ..using the following query it doesn't work:
SELECT u.* FROM room u
JOIN facilities_r fu
ON fu.id_uc=u.id_uc
AND fu.id_fu = '4'
AND fu.id_fu = '3'
WHERE 1
AND vizibility = '1'
GROUP BY id_uc
ORDER BY u_premium DESC, id_uc DESC
我不明白为什么它不工作,但我不知道如何把条件。