I have a specific thing in mind that can't be solved by a very simple multi-subquery SELECT
, shown on the bottom: take the query 1
SELECT playername AS Rookie FROM MinecraftMySQL.`lb-players` WHERE onlinetime >= 129600 AND onlinetime < 648000 ORDER BY playername;
which returns result like
+------------------+
| Rookie |
+------------------+
| _Golden_Apple |
| _MineTrick_ |
+------------------+
(just a portion of the whole result) and query 2
SELECT playername AS Eager FROM MinecraftMySQL.`lb-players` WHERE onlinetime >= 648000 AND onlinetime < 1296000 ORDER BY playername;
that returns like (just a portion of the whole result)
+-----------------+
| Eager |
+-----------------+
| 1Herofox |
| 1lyndon |
+-----------------+
The idea is to combine those columns to get something like this:
+------------------+-----------------+
| Rookie | Eager |
+------------------+-----------------+
| _Golden_Apple | 1Herofox |
| _MineTrick_ | 1lyndon |
+------------------+-----------------+
A query like
SELECT
(SELECT playername FROM MinecraftMySQL.`lb-players` WHERE onlinetime >= 129600 AND onlinetime < 648000) AS Rookie,
(SELECT playername FROM MinecraftMySQL.`lb-players` WHERE onlinetime >= 648000 AND onlinetime < 1296000) AS Eager
;
leads into 1242 (21000): Subquery returns more than 1 row
. Googling is a problem because I have no idea what words to use; used
mysql merge subqueries that return multiple rows
mysql multiple columns in result from subqueries
mysql select multiple queries as columns
just to get something totally different.
The result is mostly for human viewing only and the rows have nothing to do with other columns', so what means are used to merge those columns like that doesn't matter as long as performance isn't dropped too much; given they are not related at all, makes JOIN
s look like wrong tool.
That's where my understanding stops.