Array
(
    [0] => Array
        (
            [file] => /home/koima/html/lib/db_mysql.class.html
            [line] => 32
            [function] => calleeInfo
            [args] => Array
                (
                )

        )

    [1] => Array
        (
            [file] => /home/koima/html/lib/db_mysql.class.html
            [line] => 41
            [function] => query
            [class] => DB
            [type] => ->
            [object] => DB Object
                (
                    [conn] => Resource id #43
                    [db] => koima
                    [result] => Array
                        (
                            [0] => Resource id #62
                            [1] => 
                            [2] => Resource id #58
                        )

                )

            [args] => Array
                (
                    [0] => SELECT
TEMP.main_item_no AS main_item_no
,TEMP.main_item_name AS main_item_name
,ROUND(SUM(TEMP.main_index), 2) AS main_index
,ROUND(SUM(TEMP.last_month_main_index), 2) AS last_month_main_index
,ROUND(SUM(TEMP.last_year_main_index), 2) AS last_year_main_index
,ROUND(SUM(TEMP.main_index)/SUM(TEMP.last_month_main_index) * 100 - 100, 2) AS last_month_change
,ROUND(SUM(TEMP.main_index)/SUM(TEMP.last_year_main_index) * 100 - 100, 2) AS last_year_change
,(SELECT mc_code FROM frame_menu_category WHERE mc_url LIKE CONCAT('%main_item_no=', TEMP.main_item_no, '%')) AS skin
FROM(
	SELECT
	P.index_price AS index_price
	,M.main_item_name AS main_item_name
	,S.main_item_no AS main_item_no
	,S.sub_item_no AS sub_item_no
	,S.sub_item_part_basis AS sub_item_part_basis
	,S.sub_item_part_ratio AS sub_item_part_ratio
	,(P.index_price * S.sub_item_part_ratio / S.sub_item_part_basis) AS main_index
	,(	SELECT
		(P2.index_price * S2.sub_item_part_ratio / S2.sub_item_part_basis)
		FROM
		koima_index_price AS P2
		RIGHT OUTER JOIN
		koima_index_sub_item AS S2
		ON P2.sub_item_no = S2.sub_item_no
		WHERE P2.index_date = (
			SELECT index_date
			FROM koima_index_price
			WHERE index_date <= DATE_FORMAT(DATE_SUB('2019-05-01', INTERVAL 1 MONTH) , '%Y-%m-01')
			ORDER BY index_date DESC
			LIMIT 1, 1
		)
		AND P2.sub_item_no = S.sub_item_no
	) AS last_month_main_index
	,(	SELECT
		(P3.index_price * S3.sub_item_part_ratio / S3.sub_item_part_basis)
		FROM
		koima_index_price AS P3
		RIGHT OUTER JOIN
		koima_index_sub_item AS S3
		ON P3.sub_item_no = S3.sub_item_no
		WHERE P3.index_date = (
			SELECT index_date
			FROM koima_index_price
			WHERE index_date <= DATE_FORMAT(DATE_SUB('2019-05-01', INTERVAL 1 YEAR) , '%Y-%m-01')
			ORDER BY index_date DESC
			LIMIT 1, 1
		)
		AND P3.sub_item_no = S.sub_item_no
	) AS last_year_main_index
	FROM
	koima_index_price AS P
	RIGHT OUTER JOIN
	koima_index_sub_item AS S
	ON P.sub_item_no = S.sub_item_no
	RIGHT OUTER JOIN
	koima_index_main_item AS M
	ON S.main_item_no = M.main_item_no
	WHERE P.index_date = DATE_FORMAT('2019-05-01' , '%Y-%m-01' )
) TEMP
GROUP BY TEMP.main_item_no
                    [1] => 1
                    [2] => 
                )

        )

    [2] => Array
        (
            [file] => /home/koima/html/modules/koima_index/koima_index_intro.html
            [line] => 75
            [function] => queryFetchAll
            [class] => DB
            [type] => ->
            [object] => DB Object
                (
                    [conn] => Resource id #43
                    [db] => koima
                    [result] => Array
                        (
                            [0] => Resource id #62
                            [1] => 
                            [2] => Resource id #58
                        )

                )

            [args] => Array
                (
                    [0] => SELECT
TEMP.main_item_no AS main_item_no
,TEMP.main_item_name AS main_item_name
,ROUND(SUM(TEMP.main_index), 2) AS main_index
,ROUND(SUM(TEMP.last_month_main_index), 2) AS last_month_main_index
,ROUND(SUM(TEMP.last_year_main_index), 2) AS last_year_main_index
,ROUND(SUM(TEMP.main_index)/SUM(TEMP.last_month_main_index) * 100 - 100, 2) AS last_month_change
,ROUND(SUM(TEMP.main_index)/SUM(TEMP.last_year_main_index) * 100 - 100, 2) AS last_year_change
,(SELECT mc_code FROM frame_menu_category WHERE mc_url LIKE CONCAT('%main_item_no=', TEMP.main_item_no, '%')) AS skin
FROM(
	SELECT
	P.index_price AS index_price
	,M.main_item_name AS main_item_name
	,S.main_item_no AS main_item_no
	,S.sub_item_no AS sub_item_no
	,S.sub_item_part_basis AS sub_item_part_basis
	,S.sub_item_part_ratio AS sub_item_part_ratio
	,(P.index_price * S.sub_item_part_ratio / S.sub_item_part_basis) AS main_index
	,(	SELECT
		(P2.index_price * S2.sub_item_part_ratio / S2.sub_item_part_basis)
		FROM
		koima_index_price AS P2
		RIGHT OUTER JOIN
		koima_index_sub_item AS S2
		ON P2.sub_item_no = S2.sub_item_no
		WHERE P2.index_date = (
			SELECT index_date
			FROM koima_index_price
			WHERE index_date <= DATE_FORMAT(DATE_SUB('2019-05-01', INTERVAL 1 MONTH) , '%Y-%m-01')
			ORDER BY index_date DESC
			LIMIT 1, 1
		)
		AND P2.sub_item_no = S.sub_item_no
	) AS last_month_main_index
	,(	SELECT
		(P3.index_price * S3.sub_item_part_ratio / S3.sub_item_part_basis)
		FROM
		koima_index_price AS P3
		RIGHT OUTER JOIN
		koima_index_sub_item AS S3
		ON P3.sub_item_no = S3.sub_item_no
		WHERE P3.index_date = (
			SELECT index_date
			FROM koima_index_price
			WHERE index_date <= DATE_FORMAT(DATE_SUB('2019-05-01', INTERVAL 1 YEAR) , '%Y-%m-01')
			ORDER BY index_date DESC
			LIMIT 1, 1
		)
		AND P3.sub_item_no = S.sub_item_no
	) AS last_year_main_index
	FROM
	koima_index_price AS P
	RIGHT OUTER JOIN
	koima_index_sub_item AS S
	ON P.sub_item_no = S.sub_item_no
	RIGHT OUTER JOIN
	koima_index_main_item AS M
	ON S.main_item_no = M.main_item_no
	WHERE P.index_date = DATE_FORMAT('2019-05-01' , '%Y-%m-01' )
) TEMP
GROUP BY TEMP.main_item_no
                    [1] => 1
                )

        )

)

Query failed error#1242 : Subquery returns more than 1 row(SELECT TEMP.main_item_no AS main_item_no ,TEMP.main_item_name AS main_item_name ,ROUND(SUM(TEMP.main_index), 2) AS main_index ,ROUND(SUM(TEMP.last_month_main_index), 2) AS last_month_main_index ,ROUND(SUM(TEMP.last_year_main_index), 2) AS last_year_main_index ,ROUND(SUM(TEMP.main_index)/SUM(TEMP.last_month_main_index) * 100 - 100, 2) AS last_month_change ,ROUND(SUM(TEMP.main_index)/SUM(TEMP.last_year_main_index) * 100 - 100, 2) AS last_year_change ,(SELECT mc_code FROM frame_menu_category WHERE mc_url LIKE CONCAT('%main_item_no=', TEMP.main_item_no, '%')) AS skin FROM( SELECT P.index_price AS index_price ,M.main_item_name AS main_item_name ,S.main_item_no AS main_item_no ,S.sub_item_no AS sub_item_no ,S.sub_item_part_basis AS sub_item_part_basis ,S.sub_item_part_ratio AS sub_item_part_ratio ,(P.index_price * S.sub_item_part_ratio / S.sub_item_part_basis) AS main_index ,( SELECT (P2.index_price * S2.sub_item_part_ratio / S2.sub_item_part_basis) FROM koima_index_price AS P2 RIGHT OUTER JOIN koima_index_sub_item AS S2 ON P2.sub_item_no = S2.sub_item_no WHERE P2.index_date = ( SELECT index_date FROM koima_index_price WHERE index_date <= DATE_FORMAT(DATE_SUB('2019-05-01', INTERVAL 1 MONTH) , '%Y-%m-01') ORDER BY index_date DESC LIMIT 1, 1 ) AND P2.sub_item_no = S.sub_item_no ) AS last_month_main_index ,( SELECT (P3.index_price * S3.sub_item_part_ratio / S3.sub_item_part_basis) FROM koima_index_price AS P3 RIGHT OUTER JOIN koima_index_sub_item AS S3 ON P3.sub_item_no = S3.sub_item_no WHERE P3.index_date = ( SELECT index_date FROM koima_index_price WHERE index_date <= DATE_FORMAT(DATE_SUB('2019-05-01', INTERVAL 1 YEAR) , '%Y-%m-01') ORDER BY index_date DESC LIMIT 1, 1 ) AND P3.sub_item_no = S.sub_item_no ) AS last_year_main_index FROM koima_index_price AS P RIGHT OUTER JOIN koima_index_sub_item AS S ON P.sub_item_no = S.sub_item_no RIGHT OUTER JOIN koima_index_main_item AS M ON S.main_item_no = M.main_item_no WHERE P.index_date = DATE_FORMAT('2019-05-01' , '%Y-%m-01' ) ) TEMP GROUP BY TEMP.main_item_no)