TOYOTA CROWN
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 ='crown' AND KAT.HYOJIFLG = 1 ORDER BY NENSHIKIFR,NENSHIKITO, MC,GRADE
Array
(
[crown_170series_1] => Array
(
[NAME] => 180系
[NAMEEN] => 180series
[SHANAMEEN] => CROWN
[ORDER] => 80
[GRADE] => 全車対応
[MC] => MC前
[MODELYEAR] => '03/12-'08/02
[YEAR] => '03/12-'05/10
[COUNT] => 0
)
[crown_180series_1] => Array
(
[NAME] => 180系
[NAMEEN] => 180series
[SHANAMEEN] => CROWN
[ORDER] => 80
[GRADE] => 全車対応
[MC] => MC後
[MODELYEAR] => '03/12-'08/02
[YEAR] => '05/10-'08/02
[COUNT] => 1
)
[crown_180series_2] => Array
(
[NAME] => 200系
[NAMEEN] => 200series
[SHANAMEEN] => CROWN
[ORDER] => 80
[GRADE] => 全車対応
[MC] => MC前
[MODELYEAR] => '08/02-'12/12
[YEAR] => '08/02-'10/02
[COUNT] => 2
)
[crown_200series_1] => Array
(
[NAME] => 200系
[NAMEEN] => 200series
[SHANAMEEN] => CROWN
[ORDER] => 80
[GRADE] => 全車対応
[MC] => MC後
[MODELYEAR] => '08/02-'12/12
[YEAR] => '10/02-'12/12
[COUNT] => 3
)
[crown_200series_2] => Array
(
[NAME] => 210系
[NAMEEN] => 210series
[SHANAMEEN] => CROWN
[ORDER] => 80
[GRADE] => 全車対応
[MC] => MC前
[MODELYEAR] => '12/12-'18/06
[YEAR] => '12/12-'15/10
[COUNT] => 4
)
[crown_210series_1] => Array
(
[NAME] => 210系
[NAMEEN] => 210series
[SHANAMEEN] => CROWN
[ORDER] => 80
[GRADE] => 全車対応
[MC] => MC後
[MODELYEAR] => '12/12-'18/06
[YEAR] => '15/10-'18/06
[COUNT] => 5
)
[crown_220series_1] => Array
(
[NAME] => 220系
[NAMEEN] => 220series
[SHANAMEEN] => CROWN
[ORDER] => 80
[GRADE] => 全車対応
[MC] =>
[MODELYEAR] => '18/06-
[YEAR] => '18/06-
[COUNT] => 6
)
)
180系 '03/12-'08/02
200系 '08/02-'12/12
210系 '12/12-'18/06
220系 '18/06-