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