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 WHERE SHA.URLNAME ='noah' AND KAT.HYOJIFLG = 1 ORDER BY NENSHIKIFR,NENSHIKITO, MC,GRADE
Array
(
[noah_60series_4] => Array
(
[NAME] => 60系
[NAMEEN] => 60series
[SHANAMEEN] => NOAH
[ORDER] => 50
[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] => 50
[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] => 50
[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] => 50
[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] => 50
[GRADE] => G,X,YY
[MC] => MC前
[MODELYEAR] => '07/06-'14/01
[YEAR] => '07/06-'10/04
[COUNT] => 4
)
[noah_70series_2] => Array
(
[NAME] => 70系
[NAMEEN] => 70series
[SHANAMEEN] => NOAH
[ORDER] => 50
[GRADE] => Si,S
[MC] => MC前
[MODELYEAR] => '07/06-'14/01
[YEAR] => '07/06-'10/04
[COUNT] => 5
)
[noah_70series_1] => Array
(
[NAME] => 70系
[NAMEEN] => 70series
[SHANAMEEN] => NOAH
[ORDER] => 50
[GRADE] => 全車対応
[MC] => MC後
[MODELYEAR] => '07/06-'14/01
[YEAR] => '10/04-'14/01
[COUNT] => 6
)
[noah_80series_1] => Array
(
[NAME] => 80系
[NAMEEN] => 80series
[SHANAMEEN] => NOAH
[ORDER] => 50
[GRADE] => 全車対応
[MC] => MC前
[MODELYEAR] => '14/04-
[YEAR] => '14/04-'17/07
[COUNT] => 7
)
[noah_80series_3] => Array
(
[NAME] => 80系
[NAMEEN] => 80series
[SHANAMEEN] => NOAH
[ORDER] => 50
[GRADE] => G,X
[MC] => MC後
[MODELYEAR] => '14/04-
[YEAR] => '17/07-
[COUNT] => 8
)
[noah_80series_2] => Array
(
[NAME] => 80系
[NAMEEN] => 80series
[SHANAMEEN] => NOAH
[ORDER] => 50
[GRADE] => Si
[MC] => MC後
[MODELYEAR] => '14/04-
[YEAR] => '17/07-
[COUNT] => 9
)
)
60系 '01/11-'07/06
70系 '07/06-'14/01
80系 '14/04-