我有两个表T1和T2,其中t2是子查询的结果
说清楚
select * from T1 join (select * from T3 where foo is not null) T2 on T1.key = T2.fk
答案 0 :(得分:0)
SELECT T1 FROM Table1Entity T1 JOIN Table1Entity.table2EntityAssociationField T2 WHERE T2.foo IS NOT NULL
其中
@Entity
class Table1Entity {
@OneToOne
Table2Entity table2EntityAssociationField;
}
和
@Entity
class Table2Entity {
private Object foo;
}