我正在尝试做的示意图代码:
INPUT VAR inputOne; (First input of the desired statement)
INPUT VAR inputTwo; (Second input of the desired statement)
INPUT VAR inputThree; (Third input of the desired statement)
-
VAR repResult = getResult("SELECT * FROM `representatives` WHERE `rID` = inputOne LIMIT 1;")
VAR evResult = getResult("SELECT `events`.`eID` FROM `events` WHERE `eventDateTime` = inputTwo LIMIT 1;")
if (repResult != null && evResult != null) {
execureQuery("INSERT INTO `votes` (`representatives_rID`, `events_eID`, `voteResult`) VALUES(inputOne,evResult.eID,inputThree);");
}
当我在单独的语句中执行它们时,它非常慢,特别是因为有 ~1.000.000 需要检查和插入。我想知道,是否有任何替代的单查询方式来执行此操作。