I would like you to help me, I have 2 tables, and my intention is as follows, I write it in the image:
This is the query that I have:
$query = "SELECT Nombre, Cedula, sum(HorasTrabajo) as HorasTrabajo, sum(VC) as VC, ValorVC, sum(VR) as VR, ValorVR, sum(PA) as PA, ValorPA, sum(PRG) as PRG, ValorPRG,
sum(PRI) as PRI, ValorPRI, sum(TAC) as TAC, ValorTAC, sum(TRM) as TRM, ValorTRM, sum(MLC) as MLC, ValorMLC, sum(BENDA) as BENDA, ValorBenda,
sum(EVS) as EVS, ValorEVS, sum(ADM) as ADM, ValorADM, sum(CRG) as CRG, ValorCRG, sum(CDS) as CDS, ValorCDS, sum(CNST) as CNST, ValorCNST,
sum(MTA) as MTA, ValorMTA, sum(MTDCH) as MTDCH, ValorMTDCH, sum(MTDPT) as MTDPT, ValorMTDPT, sum(Otros) as Otros, ValorOtros, FROM reportebeteitiva
SUM(VC*ValorVC) AS JIJIJI GROUP BY Cedula
What I want is for the VC column to be multiplied by the VC Value, but each individual record and the total of these multiplications add up and give me the result in the total field. Grcias for the help.