I am having a lot of problems with the following structure. Please could anybody help me with this.

SELECT
                MAX(intermediate.test)
            FROM               
              (
              
              SELECT SUM(table.field) FROM tabledfsd INNER JOIN ....
              +
              SELECT SUM(table.field) FROM tabledfsd INNER JOIN ....
              
              ) intermediate

//or simplier example

SELECT
                MAX(intermediate.test)
            FROM               
              (
              
              SELECT SUM(1+4)
              +
              SELECT SUM(2+6)
              
              ) intermediate

What is a correct syntax for this? Is even possible to calculate two selects inside subquery?

tnx!

post table structure with sample data and then post expected output,

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.