I have view which gives reasonably correct answer:

```
   DELIMITER $$

DROP VIEW IF EXISTS `test`.`new_temp`$$

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `new_temp` AS 
SELECT `temp`.`pcount` AS `ind_type`,SUM(`temp`.`pcount`) AS `Index_val` FROM `temp` UNION ALL 
SELECT `temp`.`ncount` AS `sum`,SUM(`temp`.`ncount`) AS `ncount` FROM `temp` $$

DELIMITER ;

```

Ouput:

```
ind_type    Index_val
----------------------
2              23
2              34

```

I want it to give this kinda output:

```
New_temp

  ind_type     Index_val
-------------------------------
    pcount         23
    ncount         34

```

Problem is with code I have written. I tried in different way but i did not get it. any idea?