Hello,
Can you help me please.
I have two tables :
CREATE TABLE `expenses` (
`id` int(11) NOT NULL,
`user_id` int(11) DEFAULT NULL,
`value` decimal(10,2) DEFAULT NULL,
`mission_id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `costs ` (
`id` int(11) NOT NULL,
`user_id` int(11) DEFAULT NULL,
`value` decimal(10,2) DEFAULT NULL,
`mission_id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
How I can change the method searching to get for each user the mission_id with the sum of costs (value) and expenses (value)
Thank’s