NSPredicate JOIN 两个 table OBJECTIVE C
NSPredicate JOIN two table OBJECTIVE C
我正在做一个 IPAD 项目,我需要加入两个 table。
因为我必须获取 JOIN 结果。
举例
SELECT *
FROM Table1 t1
JOIN Table2 t2 ON t1.id2 = t2.id1
WHERE [condition]
我如何使用 NSPredicate 做到这一点?
是否可以使用此查询创建视图?
如果你想使用NSPredicate
Limitations: You cannot necessarily translate “arbitrary” SQL queries
into predicates or fetch requests. There is no way, for example, to
convert a SQL statement [...] into a fetch request. You must fetch the objects of interest, then either
perform a calculation directly using the results, or use an array
operator.
我正在做一个 IPAD 项目,我需要加入两个 table。 因为我必须获取 JOIN 结果。
举例
SELECT *
FROM Table1 t1
JOIN Table2 t2 ON t1.id2 = t2.id1
WHERE [condition]
我如何使用 NSPredicate 做到这一点? 是否可以使用此查询创建视图?
如果你想使用NSPredicate
Limitations: You cannot necessarily translate “arbitrary” SQL queries into predicates or fetch requests. There is no way, for example, to convert a SQL statement [...] into a fetch request. You must fetch the objects of interest, then either perform a calculation directly using the results, or use an array operator.