Query Error when trying to run query Please bear with me as I am relatively new to SQL. I am using MySQL and trying to run a query against a DB with two tables ('Network', and 'Server'). When I trying a portion of the query it executes without fail, however, when I try and add to it, I receive nothing but errors ranging from 1046 to 1140 to 1241. I am sure it is a matter of syntax and formatting, but I cannot figure it out. Please help. Below is my query:

SELECT (SELECT CONCAT(ROUND(SUM(server.Tech=7)/COUNT(server.Tech) * 100,2), '%') AS Server,
       CONCAT(ROUND(SUM(network.Tech=7)/COUNT(network.Tech) * 100,2), '%') AS Network
           FROM network join server) AS V,
    (SELECT CONCAT(ROUND(SUM(server.Tech=2)/COUNT(server.Tech) * 100,2), '%') AS Server,
       CONCAT(ROUND(SUM(network.Tech=2)/COUNT(network.Tech) * 100,2), '%') AS Network
           FROM network join server) AS J
    (SELECT CONCAT(ROUND(SUM(server.Tech=4)/COUNT(server.Tech) * 100,2), '%') AS Server,
       CONCAT(ROUND(SUM(network.Tech=4)/COUNT(network.Tech) * 100,2), '%') AS Network
           FROM network join server) AS K
You have to join the tables on a value.  I'm taking a wild guess here, but I think you might be looking for something like this:

SELECT (SELECT CONCAT(ROUND(SUM(server.Tech=7)/COUNT(server.Tech) * 100,2), '%') AS Server,
CONCAT(ROUND(SUM(network.Tech=7)/COUNT(network.Tech) * 100,2), '%') AS Network
           FROM network join server

On network.Tech = server.Tech

) AS V,


I don't know what your equals sign is doing in your arithmetic operation.  Are you trying to pull all Tech where it equals 7?  If so, it would be

SELECT (SELECT CONCAT(ROUND(SUM(server.Tech)/COUNT(server.Tech) * 100,2), '%') AS Server,
CONCAT(ROUND(SUM(network.Tech)/COUNT(network.Tech) * 100,2), '%') AS Network
           FROM network join server

On network.Tech = server.Tech
WHERE server.Tech = 7 AND network.Tech=7

) AS V,


Of course, if you are trying to sum all Techs that equal 7 over the full rowcount, it will need more work.