NISSAN ELGRAND
SQL
SELECT * , KAT.URLNAME AS KATURLNAME FROM M_KATASHIKI KAT LEFT OUTER JOIN M_SHASHU SHA ON SHA.SHACODE = KAT.SHACODE AND SHA.MAKCODE = KAT.MAKCODE LEFT OUTER JOIN ( SELECT MAKCODE , SHACODE ,KATNAME AS KATNAME1 , MIN(NENSHIKIFR) AS FROMOLD, MAX(NENSHIKIFR) AS FROMNEW, MIN(NENSHIKITO) AS TOOLD, MAX(NENSHIKITO) AS TONEW FROM M_KATASHIKI KAT WHERE KAT.HYOJIFLG = 1 GROUP BY MAKCODE, SHACODE, KATNAME1 ) kts ON kts.MAKCODE= KAT.MAKCODE AND kts.SHACODE= KAT.SHACODE AND kts.KATNAME1= KAT.KATNAME WHERE SHA.URLNAME ='elgrand' AND KAT.HYOJIFLG = 1 ORDER BY NENSHIKIFR,NENSHIKITO, MC,GRADE
Array
(
[elgrand_e51_1] => Array
(
[NAME] => E51
[NAMEEN] => E51
[SHANAMEEN] => ELGRAND
[ORDER] => 90
[GRADE] => HighwaySTAR
[MC] => MC前
[MODELYEAR] => '02/05-'10/08
[YEAR] => '02/05-'04/08
[COUNT] => 0
)
[elgrand_e51_3] => Array
(
[NAME] => E51
[NAMEEN] => E51
[SHANAMEEN] => ELGRAND
[ORDER] => 90
[GRADE] => 全車対応
[MC] => MC後
[MODELYEAR] => '02/05-'10/08
[YEAR] => '04/08-'10/08
[COUNT] => 1
)
[elgrand_e52_1] => Array
(
[NAME] => E52
[NAMEEN] => E52
[SHANAMEEN] => ELGRAND
[ORDER] => 90
[GRADE] => 全車対応
[MC] => MC前
[MODELYEAR] => '10/08-
[YEAR] => '10/08-'14/01
[COUNT] => 2
)
[elgrand_e52_2] => Array
(
[NAME] => E52
[NAMEEN] => E52
[SHANAMEEN] => ELGRAND
[ORDER] => 90
[GRADE] => 全車対応
[MC] => MC後
[MODELYEAR] => '10/08-
[YEAR] => '14/01-
[COUNT] => 3
)
)
E51 '02/05-'10/08
E52 '10/08-