Skip to content
Advertisement

MySQL sum() from more than 1 table

Ok, so every sum() returns the desired value, I already checked it but I’m having problems when trying to sum everything together and then get the total value. Basically I have to do this: initial Fee(which is a set value defined on the”customer” table) + sum of activity1 cost + sum of activity2 cost == value But I don’t know

SQL query fetching data from multiple tables and displaying in html table

I am working on a system that fetches data from three tables. My query takes input from a form stored in variables named $departure and $destination. However the query is not working when i use these variables but if i enter result in sql query then it fetches data from sql. I echoed $departure and $destination to check if they

How to get x top results for each year SQLite

I’ve got a problem with my solution, I found this example: (SELECT COUNT(*) FROM person AS b WHERE b.group = a.group AND b.age >= a.age) <= 2 ORDER BY a.group ASC, a.age DESC (from: …

Advertisement