我正在尝试进行此查询
SELECT * FROM district
WHERE id = ANY (SELECT districtId FROM address
WHERE id = ANY (SELECT addressId FROM schedule
WHERE workshopId = '1'))
我真正的问题是插入ANY
语句。
有谁知道如何在Zend Framework 2中将ANY
或ALL
应用于查询?
答案 0 :(得分:0)
为什么不使用连接表?
select * from distrinct as d
join address as a using(districtId)
join schedule as s on s.addressId=a.addressId and s.workshopId = '1';
问候