with x as (SELECT account, symbol, direction, "position" ,(positionprofit + closeprofit ) as profitX
FROM public.jstrader_position where trading_day ='20220701' and account ='a' order by symbol )
,
y as (SELECT account, symbol, direction, "position" ,(positionprofit + closeprofit ) as profitY
FROM public.jstrader_position where trading_day ='20220701' and account ='b' order by symbol)
select * from (X full join Y on (X.symbol=Y.symbol and x.direction = y.direction) )
SQL对比两个表
最新推荐文章于 2024-08-09 10:54:35 发布