salix/db/routines/psico/procedures/getExamQuestions.sql

13 lines
347 B
MySQL
Raw Normal View History

DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `psico`.`getExamQuestions`(vExamFk INT)
BEGIN
SELECT p.text,p.examFk,p.questionFk,p.answerFk,p.id ,a.text AS answerText,a.correct, a.id AS answerFk
FROM psico.examView as p
INNER JOIN psico.answer as a ON p.questionFk = a.questionFk
WHERE examFk = vExamFk;
END$$
DELIMITER ;