NISSAN SERENA
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 ='serena' AND KAT.HYOJIFLG = 1 ORDER BY NENSHIKIFR,NENSHIKITO, MC,GRADE
Array
(
[serena_c27_1] => Array
(
[NAME] => C25
[NAMEEN] => C25
[SHANAMEEN] => SERENA
[ORDER] => 70
[GRADE] => 全車対応
[MC] =>
[MODELYEAR] => '05/05-'10/11
[YEAR] => '05/05-'10/11
[COUNT] => 0
)
[serena_c25_1] => Array
(
[NAME] => C26
[NAMEEN] => C26
[SHANAMEEN] => SERENA
[ORDER] => 70
[GRADE] => 全車対応
[MC] =>
[MODELYEAR] => '10/11-'16/08
[YEAR] => '10/11-'16/08
[COUNT] => 1
)
[serena_c26_1] => Array
(
[NAME] => C27
[NAMEEN] => C27
[SHANAMEEN] => SERENA
[ORDER] => 70
[GRADE] => 全車対応
[MC] => MC前
[MODELYEAR] => '16/08-
[YEAR] => '16/08-'19/08
[COUNT] => 2
)
[serena_c27_2] => Array
(
[NAME] => C27
[NAMEEN] => C27
[SHANAMEEN] => SERENA
[ORDER] => 70
[GRADE] => 全車対応
[MC] => MC後
[MODELYEAR] => '16/08-
[YEAR] => '19/08-
[COUNT] => 3
)
)
C25 '05/05-'10/11
C26 '10/11-'16/08
C27 '16/08-