SUBARU BRZ
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 ='brz' AND KAT.HYOJIFLG = 1 ORDER BY NENSHIKIFR,NENSHIKITO, MC,GRADE
Array
(
[brz_zc6_1] => Array
(
[NAME] => ZC6
[NAMEEN] => ZC6
[SHANAMEEN] => BRZ
[ORDER] => 99
[GRADE] => 全車対応
[MC] => MC前
[MODELYEAR] => '12/03-
[YEAR] => '12/03-'16/08
[COUNT] => 0
)
[brz_zc6_2] => Array
(
[NAME] => ZC6
[NAMEEN] => ZC6
[SHANAMEEN] => BRZ
[ORDER] => 99
[GRADE] => 全車対応
[MC] => MC後
[MODELYEAR] => '12/03-
[YEAR] => '16/08-
[COUNT] => 1
)
)
ZC6 '12/03-