TOYOTA VOXY
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 ='voxy' AND GRP.BRACODE = '11' AND KAT.HYOJIFLG = 1 ORDER BY NENSHIKIFR,NENSHIKITO, MC,GRADE
Array
(
[voxy_60series_1] => Array
(
[NAME] => 60系
[NAMEEN] => 60series
[SHANAMEEN] => VOXY
[ORDER] => 20
[GRADE] => V,X
[MC] => MC前
[MODELYEAR] => '01/11-'07/06
[YEAR] => '01/11-'04/08
[COUNT] => 0
)
[voxy_60series_3] => Array
(
[NAME] => 60系
[NAMEEN] => 60series
[SHANAMEEN] => VOXY
[ORDER] => 20
[GRADE] => Z
[MC] => MC前
[MODELYEAR] => '01/11-'07/06
[YEAR] => '01/11-'04/08
[COUNT] => 1
)
[voxy_60series_2] => Array
(
[NAME] => 60系
[NAMEEN] => 60series
[SHANAMEEN] => VOXY
[ORDER] => 20
[GRADE] => X,TRANS-X
[MC] => MC後
[MODELYEAR] => '01/11-'07/06
[YEAR] => '04/08-'07/06
[COUNT] => 2
)
[voxy_60series_4] => Array
(
[NAME] => 60系
[NAMEEN] => 60series
[SHANAMEEN] => VOXY
[ORDER] => 20
[GRADE] => Z
[MC] => MC後
[MODELYEAR] => '01/11-'07/06
[YEAR] => '04/08-'07/06
[COUNT] => 3
)
[voxy_70series_1] => Array
(
[NAME] => 70系
[NAMEEN] => 70series
[SHANAMEEN] => VOXY
[ORDER] => 20
[GRADE] => V,X,TRANS-X
[MC] => MC前
[MODELYEAR] => '07/06-'14/01
[YEAR] => '07/06-'10/04
[COUNT] => 11
)
[voxy_70series_3] => Array
(
[NAME] => 70系
[NAMEEN] => 70series
[SHANAMEEN] => VOXY
[ORDER] => 20
[GRADE] => ZS,Z
[MC] => MC前
[MODELYEAR] => '07/06-'14/01
[YEAR] => '07/06-'10/04
[COUNT] => 19
)
[voxy_70series_2] => Array
(
[NAME] => 70系
[NAMEEN] => 70series
[SHANAMEEN] => VOXY
[ORDER] => 20
[GRADE] => V,X,TRANS-X
[MC] => MC後
[MODELYEAR] => '07/06-'14/01
[YEAR] => '10/04-'14/01
[COUNT] => 28
)
[voxy_70series_4] => Array
(
[NAME] => 70系
[NAMEEN] => 70series
[SHANAMEEN] => VOXY
[ORDER] => 0
[GRADE] => ZS,Z
[MC] => MC後
[MODELYEAR] => '07/06-'14/01
[YEAR] => '10/04-'14/01
[COUNT] => 37
)
[voxy_80series_2] => Array
(
[NAME] => 80系
[NAMEEN] => 80series
[SHANAMEEN] => VOXY
[ORDER] => 20
[GRADE] => V,X
[MC] => MC前
[MODELYEAR] => '14/01-
[YEAR] => '14/01-'17/07
[COUNT] => 44
)
[voxy_80series_1] => Array
(
[NAME] => 80系
[NAMEEN] => 80series
[SHANAMEEN] => VOXY
[ORDER] => 0
[GRADE] => ZS
[MC] => MC前
[MODELYEAR] => '14/01-
[YEAR] => '14/01-'17/07
[COUNT] => 51
)
[voxy_80series_4] => Array
(
[NAME] => 80系
[NAMEEN] => 80series
[SHANAMEEN] => VOXY
[ORDER] => 20
[GRADE] => V,X
[MC] => MC後
[MODELYEAR] => '14/01-
[YEAR] => '17/07-
[COUNT] => 53
)
[voxy_80series_3] => Array
(
[NAME] => 80系
[NAMEEN] => 80series
[SHANAMEEN] => VOXY
[ORDER] => 20
[GRADE] => ZS
[MC] => MC後
[MODELYEAR] => '14/01-
[YEAR] => '17/07-
[COUNT] => 55
)
)
60系 '01/11-'07/06
70系 '07/06-'14/01
80系 '14/01-