Mysql存储过程不是通过执行返回值

时间:2017-08-02 06:26:05

标签: mysql phpmyadmin

这是我使用sql控制台运行的mysql查询,它正常工作但结果中没有显示,但是当我运行查询时它会返回结果。

我尝试了很多次但是没有用。为什么??

    SELECT U.assTo AS name , total_Solved, total_unsolved,total_Solved_date,total_unSolved_date FROM
   (SELECT
     assTo,
     count(*) AS total_unsolved
   FROM allinone
   WHERE assTo IN (SELECT name
                   FROM user
                   WHERE designation = 'Technical'
                   ORDER BY name)
         AND allinone.status = 'unsolved'
   GROUP BY assTo) AS U INNER JOIN
   (SELECT
     assTo,
     count(*) AS total_Solved
   FROM allinone
   WHERE assTo IN (SELECT name
                   FROM user
                   WHERE designation = 'Technical'
                   ORDER BY name) AND allinone.status = 'solved'
   GROUP BY assTo) AS S ON S.assTo = U.assTo
   INNER JOIN
   (SELECT
     assTo,
     count(*) AS total_Solved_date
   FROM allinone
   WHERE assTo IN (SELECT name
                   FROM user
                   WHERE designation = 'Technical'
                   ORDER BY name) AND allinone.status = 'solved' AND  allinone.assDate ='01/08/17'
   GROUP BY assTo) AS D ON S.assTo = D.assTo
   INNER JOIN
   (SELECT
      assTo,
      count(*) AS total_unSolved_date
    FROM allinone
    WHERE assTo IN (SELECT name
                    FROM user
                    WHERE designation = 'Technical'
                    ORDER BY name) AND allinone.status = 'unsolved' AND  allinone.assDate ='01/08/17'
    GROUP BY assTo) AS F ON S.assTo = F.assTo

我正在尝试执行但未返回任何结果

这是此表的完整代码

CREATE DEFINER=`root`@`localhost` PROCEDURE `show_all_report`() NOT DETERMINISTIC READS SQL DATA SQL SECURITY INVOKER BEGIN
SELECT U.assTo AS name , total_Solved, total_unsolved,total_Solved_date,total_unSolved_date FROM
   (SELECT
     assTo,
     count(*) AS total_unsolved
   FROM allinone
   WHERE assTo IN (SELECT name
                   FROM user
                   WHERE designation = 'Technical'
                   ORDER BY name)
         AND allinone.status = 'unsolved'
   GROUP BY assTo) AS U INNER JOIN
   (SELECT
     assTo,
     count(*) AS total_Solved
   FROM allinone
   WHERE assTo IN (SELECT name
                   FROM user
                   WHERE designation = 'Technical'
                   ORDER BY name) AND allinone.status = 'solved'
   GROUP BY assTo) AS S ON S.assTo = U.assTo
   INNER JOIN
   (SELECT
     assTo,
     count(*) AS total_Solved_date
   FROM allinone
   WHERE assTo IN (SELECT name
                   FROM user
                   WHERE designation = 'Technical'
                   ORDER BY name) AND allinone.status = 'solved' AND  allinone.assDate ='01/08/17'
   GROUP BY assTo) AS D ON S.assTo = D.assTo
   INNER JOIN
   (SELECT
      assTo,
      count(*) AS total_unSolved_date
    FROM allinone
    WHERE assTo IN (SELECT name
                    FROM user
                    WHERE designation = 'Technical'
                    ORDER BY name) AND allinone.status = 'unsolved' AND  allinone.assDate ='01/08/17'
    GROUP BY assTo) AS F ON S.assTo = F.assTo;
END

为什么不返回任何值

0 个答案:

没有答案