The BEGIN
Drop table if the exists temptable1;
The Set @ sq1=CONCAT (' the Create table temptable1 () ', SQLSTR, ' ');
PREPARE stmt1 FROM @ sq1;
The EXECUTE stmt1;
DEALLOCATE PREPARE stmt1;
The SET @ EE=' ';
SELECT
GROUP_CONCAT (DISTINCT
CONCAT (
'the SUM (IF (b.', columnname, '=' ' ', CallType, ' ' ', b. ', rowname, ', 0)) AS ' ' ', CallType, ' ' ' ')
) into @ EE
The FROM temptable1 c;
Select @ EE;
- SELECT
- GROUP_CONCAT (DISTINCT
- CONCAT (
- 'the SUM (the IF (b.' ' ', columnname, ' ' '=' ' ',
- Arthur c. allType,
- "' biggest c, 0)) AS the ' ' ',
- Arthur c. allType, '"'
-)
-) into @ EE
- the FROM reportcall c;
The SET @ QQ=CONCAT (' select '@ EE,' the from temptable1 b ', sort);
SELECT @ QQ;
PREPARE STMT FROM @ QQ;
The EXECUTE STMT.
DEALLOCATE PREPARE STMT.
END
CodePudding user response:
There is no table structure, tell me about what you want,