I have the following code that returns me two nice tables (When using the SQL function in PhpMyAdmin). However, I am unable to insert them into my TABLE B
.
How can I insert this in TABLE B rather than only showing it?
SELECT DateTimeCode, Rat,
MAX(IntendedStimulusDuration_ms) AS StimulusDuration,
SUM(Correct + Incorrect + Omission + PrematureNosepokes) AS total_trials,
SUM(Correct) AS correct,
SUM(Incorrect) AS incorrect,
SUM(Omission) AS omission,
SUM(PrematureNosepokes) AS premature,
SUM(PerseverativePanelPushes) AS P_PanelPushes,
SUM(PerseverativeNosepokes) AS P_nosepokes,
SUM(PerseverativeNosepokesSameHole) AS P_NPsame,
SUM(PerseverativeNOsepokesOtherHoles) AS P_NPother
FROM `FiveChoice_TrialData`
GROUP BY Rat,DateTimeCode;
--If correct = 1
SELECT DateTimeCode, Rat,
AVG(ResponseLatency_ms) AS ResponseLatency,
AVG(CollectionLatency_ms) AS CollectionLatency
FROM `FiveChoice_TrialData`
WHERE Correct = 1
GROUP BY Rat,DateTimeCode;
Basically I tried:
INSERT INTO TABLE_B (--all my col names, just like the alias stated above)
VALUE (--My two select statement as written above, separated by a coma)