Skip to content
Advertisement

How to substract 2 columns from different table with using count function? [closed]

Currently, I am using count function to calculate the value for 2 columns and wanna substract the 2 columns and export to excel file.

This is my code. I think the bold statement contains logical error.

Advertisement

Answer

I think you want two LEFT JOINs on aggregate queries:

In very recent versions of MySQL, you could use lateral joins:

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement