mysql内连接取记录类似行转列

次年进账金额'from A,(select jn.FID, jn.年收入进账时间, jn.进账金额 from B 'jn' where jn.年收入进账时间 like '2013-%') J,(select cn.FID, cn.年收入进账时间, cn.进账金额 from B 'cn' where cn.年收入进账时间 like '2014-%') C,where A.ID=J.FID and C.FID=A.ID ...
mysql内连接取记录类似行转列
select A.ID, A.姓名, J.年收入进账时间 AS '今年年收入进账时间', J.进账金额 AS '今年进账金额', C.年收入进账时间 AS '次年年收入进账时间', C.进账金额 AS '次年进账金额'
from A,
(select jn.FID, jn.年收入进账时间, jn.进账金额 from B 'jn' where jn.年收入进账时间 like '2013-%') J,
(select cn.FID, cn.年收入进账时间, cn.进账金额 from B 'cn' where cn.年收入进账时间 like '2014-%') C,
where A.ID=J.FID
and C.FID=A.ID2014-02-25
mengvlog 阅读 62 次 更新于 2025-12-14 20:00:12 我来答关注问题0
檬味博客在线解答立即免费咨询

mySQL相关话题

Copyright © 2023 WWW.MENGVLOG.COM - 檬味博客
返回顶部