SUBARU LEGACY
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 ='legacy' AND KAT.HYOJIFLG = 1 ORDER BY NENSHIKIFR,NENSHIKITO, MC,GRADE
Array
(
[legacy_brseries_1] => Array
(
[NAME] => BH系
[NAMEEN] => BHseries
[SHANAMEEN] => LEGACY
[ORDER] => 10
[GRADE] => 全車対応
[MC] =>
[MODELYEAR] => '98/06-
[YEAR] => '98/06-
[COUNT] => 0
)
[legacy_bhseries_1] => Array
(
[NAME] => BP系
[NAMEEN] => BPseries
[SHANAMEEN] => LEGACY
[ORDER] => 10
[GRADE] => 2.0GT spec.B
[MC] => MC前
[MODELYEAR] => '03/05-'09/05
[YEAR] => '03/05-'06/05
[COUNT] => 1
)
[legacy_bpseries_1] => Array
(
[NAME] => BP系
[NAMEEN] => BPseries
[SHANAMEEN] => LEGACY
[ORDER] => 10
[GRADE] => 2.0GT,2.0R,2.0i
[MC] => MC前
[MODELYEAR] => '03/05-'09/05
[YEAR] => '03/05-'06/05
[COUNT] => 2
)
[legacy_bpseries_3] => Array
(
[NAME] => BP系
[NAMEEN] => BPseries
[SHANAMEEN] => LEGACY
[ORDER] => 10
[GRADE] => 全車対応
[MC] => MC後
[MODELYEAR] => '03/05-'09/05
[YEAR] => '06/05-'09/05
[COUNT] => 3
)
[legacy_bpseries_4] => Array
(
[NAME] => BR系
[NAMEEN] => BRseries
[SHANAMEEN] => LEGACY
[ORDER] => 10
[GRADE] => 全車対応
[MC] =>
[MODELYEAR] => '09/05-'14/06
[YEAR] => '09/05-'14/06
[COUNT] => 4
)
)
BH系 '98/06-
BP系 '03/05-'09/05
BR系 '09/05-'14/06