TOYOTA NOAH
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 ='noah' AND GRP.BRACODE = '11' AND KAT.HYOJIFLG = 1 ORDER BY NENSHIKIFR,NENSHIKITO, MC,GRADE
Array
(
[noah_60series_4] => Array
(
[NAME] => 60系
[NAMEEN] => 60series
[SHANAMEEN] => NOAH
[ORDER] => 20
[GRADE] => S
[MC] => MC前
[MODELYEAR] => '01/11-'07/06
[YEAR] => '01/11-'04/08
[COUNT] => 0
)
[noah_60series_2] => Array
(
[NAME] => 60系
[NAMEEN] => 60series
[SHANAMEEN] => NOAH
[ORDER] => 20
[GRADE] => X,L
[MC] => MC前
[MODELYEAR] => '01/11-'07/06
[YEAR] => '01/11-'04/08
[COUNT] => 1
)
[noah_60series_3] => Array
(
[NAME] => 60系
[NAMEEN] => 60series
[SHANAMEEN] => NOAH
[ORDER] => 20
[GRADE] => S
[MC] => MC後
[MODELYEAR] => '01/11-'07/06
[YEAR] => '04/08-'07/06
[COUNT] => 2
)
[noah_60series_1] => Array
(
[NAME] => 60系
[NAMEEN] => 60series
[SHANAMEEN] => NOAH
[ORDER] => 20
[GRADE] => X,YY
[MC] => MC後
[MODELYEAR] => '01/11-'07/06
[YEAR] => '04/08-'07/06
[COUNT] => 3
)
[noah_70series_3] => Array
(
[NAME] => 70系
[NAMEEN] => 70series
[SHANAMEEN] => NOAH
[ORDER] => 20
[GRADE] => G,X,YY
[MC] => MC前
[MODELYEAR] => '07/06-'14/01
[YEAR] => '07/06-'10/04
[COUNT] => 11
)
[noah_70series_2] => Array
(
[NAME] => 70系
[NAMEEN] => 70series
[SHANAMEEN] => NOAH
[ORDER] => 0
[GRADE] => Si,S
[MC] => MC前
[MODELYEAR] => '07/06-'14/01
[YEAR] => '07/06-'10/04
[COUNT] => 19
)
[noah_70series_1] => Array
(
[NAME] => 70系
[NAMEEN] => 70series
[SHANAMEEN] => NOAH
[ORDER] => 20
[GRADE] => 全車対応
[MC] => MC後
[MODELYEAR] => '07/06-'14/01
[YEAR] => '10/04-'14/01
[COUNT] => 28
)
[noah_80series_1] => Array
(
[NAME] => 80系
[NAMEEN] => 80series
[SHANAMEEN] => NOAH
[ORDER] => 20
[GRADE] => 全車対応
[MC] => MC前
[MODELYEAR] => '14/04-
[YEAR] => '14/04-'17/07
[COUNT] => 35
)
[noah_80series_3] => Array
(
[NAME] => 80系
[NAMEEN] => 80series
[SHANAMEEN] => NOAH
[ORDER] => 20
[GRADE] => G,X
[MC] => MC後
[MODELYEAR] => '14/04-
[YEAR] => '17/07-
[COUNT] => 37
)
[noah_80series_2] => Array
(
[NAME] => 80系
[NAMEEN] => 80series
[SHANAMEEN] => NOAH
[ORDER] => 20
[GRADE] => Si
[MC] => MC後
[MODELYEAR] => '14/04-
[YEAR] => '17/07-
[COUNT] => 39
)
)
60系 '01/11-'07/06
70系 '07/06-'14/01
80系 '14/04-