TOYOTA ALPHARD
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 LEFT OUTER JOIN M_JYOKEN JYO ON JYO.MAKCODE = KAT.MAKCODE AND JYO.SHACODE = KAT.SHACODE AND JYO.KATCODE = KAT.KATCODE LEFT OUTER JOIN M_SHOHINGRP GRP ON JYO.GRPCODE = GRP.GRPCODE WHERE SHA.URLNAME ='alphard' AND GRP.BRACODE = '11' AND KAT.HYOJIFLG = 1 ORDER BY NENSHIKIFR,NENSHIKITO, MC,GRADE
Array
(
[alphard_10series_1] => Array
(
[NAME] => 10系
[NAMEEN] => 10series
[SHANAMEEN] => ALPHARD
[ORDER] => 28
[GRADE] => MS,AS
[MC] => MC前
[MODELYEAR] => '02/05-'08/05
[YEAR] => '02/05-'05/05
[COUNT] => 2
)
[alphard_10series_3] => Array
(
[NAME] => 10系
[NAMEEN] => 10series
[SHANAMEEN] => ALPHARD
[ORDER] => 28
[GRADE] => MZ,MX,AX
[MC] => MC前
[MODELYEAR] => '02/05-'08/05
[YEAR] => '02/05-'05/05
[COUNT] => 5
)
[alphard_10series_2] => Array
(
[NAME] => 10系
[NAMEEN] => 10series
[SHANAMEEN] => ALPHARD
[ORDER] => 28
[GRADE] => MS,AS
[MC] => MC後
[MODELYEAR] => '02/05-'08/05
[YEAR] => '05/05-'08/05
[COUNT] => 8
)
[alphard_10series_4] => Array
(
[NAME] => 10系
[NAMEEN] => 10series
[SHANAMEEN] => ALPHARD
[ORDER] => 27
[GRADE] => MZ,MX,AX
[MC] => MC後
[MODELYEAR] => '02/05-'08/05
[YEAR] => '05/05-'08/05
[COUNT] => 11
)
[alphard_20series_1] => Array
(
[NAME] => 20系
[NAMEEN] => 20series
[SHANAMEEN] => ALPHARD
[ORDER] => 0
[GRADE] => 全車対応
[MC] => MC前
[MODELYEAR] => '08/05-'15/01
[YEAR] => '08/05-'11/11
[COUNT] => 20
)
[alphard_20series_2] => Array
(
[NAME] => 20系
[NAMEEN] => 20series
[SHANAMEEN] => ALPHARD
[ORDER] => 0
[GRADE] => 全車対応
[MC] => MC後
[MODELYEAR] => '08/05-'15/01
[YEAR] => '11/11-'15/01
[COUNT] => 29
)
[alphard_30series_1] => Array
(
[NAME] => 30系
[NAMEEN] => 30series
[SHANAMEEN] => ALPHARD
[ORDER] => 20
[GRADE] => 全車対応
[MC] => MC前
[MODELYEAR] => '15/01-
[YEAR] => '15/01-'18/01
[COUNT] => 35
)
)
10系 '02/05-'08/05
20系 '08/05-'15/01
30系 '15/01-