Skip to content
Advertisement

Tag: sum

MySQL: Join three tables, comparing two values

First of all, I’m an amateur on SQL. Here it is the example. From this three tables I would like to know who are the teachers that make more money than Mike Table1: Table2: Table3: So far I’ve made this: And I don’t know how to keep going because when I run it, an error appears. My expected result would

How to SUM two SUMmed SQL result fields

I have a simple table structure holding records of reagent_bottles and reagent_aliquots. Aliquots are created from bottles, and an aliquot record got a foreign key, bottle_id, to a bottles id. To get the total volume of a particular reagent (counting both the volume in the bottles and the volume in the aliquots), the following query does the job, partly: returns

Advertisement