select
b.security_type,
b.symbol,
b.security_description,
b.trade_date_qty as 'axys_qty',
c.trade_date_qty as 'fidelity_qty',
c.trade_date_qty - b.trade_date_qty as 'qty_diff',
b.cost_basis as 'axys_cost',
c.cost_basis as 'fidelity_cost',
c.cost_basis - b.cost_basis as 'cost_diff'
from
account a
inner join advent_position b on a.fixed_account_number = b.account_number
inner join fidelity_position c on a.fixed_account_number = c.account_number and b.symbol = c.symbol
where
b.account_number = '636296651'
基本上,我有ff。域:帐户、AdventPosition、FidelityPosition。我还没有设置关系。我只是想知道是否有一种方法可以使用 Criteria 或 HQL 来复制上述逻辑。原谅我,我还是 Grails 的新手。
感谢您对此提供任何线索。