Brady Aiello
12/03/2020, 5:34 PMCREATE VIEW
statement, does it need to be declared as a method to be generated, and then invoked at runtime?
2. Is there any limitation to the number of `VIEW`'s or nested queries you can create?Brady Aiello
12/03/2020, 5:52 PMCREATE VIEW spellsWithClasses AS
SELECT spells.*, GROUP_CONCAT(spells.className, ", ") classes
FROM
(
SELECT Spell.*, Class.className
FROM Spell JOIN Class ON Spell.name = Class.name
ORDER BY Spell.name, Class.className ASC
) spells
GROUP BY spells.name;
And to query it:
getSpellsWithClassesSortedByName:
SELECT spellsWithClasses.*,
GROUP_CONCAT(conditionInflict) conditionsInflict
FROM
spellsWithClasses LEFT JOIN ConditionInflicts ON spellsWithClasses.name = ConditionInflicts.name
GROUP BY spellsWithClasses.name
ORDER BY spellsWithClasses.name;
This query returns an NPE. Running the same query (I'm leaving out some columns for clarity) with the Database Inspector gives me what I'm expecting:Brady Aiello
12/03/2020, 6:29 PMgetSpellsWithClassesSortedByName:
SELECT spells.*, GROUP_CONCAT(spells.className, ", ") classes, GROUP_CONCAT(conditionInflict)
FROM
(
SELECT Spell.*, Class.className, ConditionInflicts.conditionInflict
FROM Spell JOIN Class ON Spell.name = Class.name LEFT JOIN ConditionInflicts ON Spell.name = ConditionInflicts.name
ORDER BY Spell.name, Class.className ASC
) spells
GROUP BY spells.name
ORDER BY spells.name;
Brady Aiello
12/07/2020, 6:42 PMCREATE VIEW
doesn't happen automatically, like CREATE TABLE
statements, or knows limitations on nested SELECT
statements or 3-way `JOIN`s, I'd still really like to know.leandro
12/10/2020, 2:58 PMBrady Aiello
12/12/2020, 12:18 AMleandro
12/12/2020, 3:12 PM