TOYOTA ESTIMA
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 ='estima' AND KAT.HYOJIFLG = 1 ORDER BY NENSHIKIFR,NENSHIKITO, MC,GRADE
Array
(
[estima_30series_1] => Array
(
[NAME] => 30系
[NAMEEN] => 30series
[SHANAMEEN] => ESTIMA
[ORDER] => 90
[GRADE] => AERAS
[MC] => MC前
[MODELYEAR] => '00/01-'06/01
[YEAR] => '00/01-'03/05
[COUNT] => 0
)
[estima_30series_3] => Array
(
[NAME] => 30系
[NAMEEN] => 30series
[SHANAMEEN] => ESTIMA
[ORDER] => 90
[GRADE] => G,X,J
[MC] => MC前
[MODELYEAR] => '00/01-'06/01
[YEAR] => '00/01-'03/05
[COUNT] => 1
)
[estima_30series_2] => Array
(
[NAME] => 30系
[NAMEEN] => 30series
[SHANAMEEN] => ESTIMA
[ORDER] => 90
[GRADE] => AERAS
[MC] => MC後
[MODELYEAR] => '00/01-'06/01
[YEAR] => '03/05-'06/01
[COUNT] => 2
)
[estima_30series_4] => Array
(
[NAME] => 30系
[NAMEEN] => 30series
[SHANAMEEN] => ESTIMA
[ORDER] => 90
[GRADE] => G,X,J
[MC] => MC後
[MODELYEAR] => '00/01-'06/01
[YEAR] => '03/05-'06/01
[COUNT] => 3
)
[estima_50series_1] => Array
(
[NAME] => 50系
[NAMEEN] => 50series
[SHANAMEEN] => ESTIMA
[ORDER] => 90
[GRADE] => 全車対応
[MC] => 1期
[MODELYEAR] => '06/01-
[YEAR] => '06/01-'08/12
[COUNT] => 4
)
[estima_50series_2] => Array
(
[NAME] => 50系
[NAMEEN] => 50series
[SHANAMEEN] => ESTIMA
[ORDER] => 90
[GRADE] => 全車対応
[MC] => 2期
[MODELYEAR] => '06/01-
[YEAR] => '08/12-'12/05
[COUNT] => 5
)
[estima_50series_3] => Array
(
[NAME] => 50系
[NAMEEN] => 50series
[SHANAMEEN] => ESTIMA
[ORDER] => 90
[GRADE] => 全車対応
[MC] => 3期
[MODELYEAR] => '06/01-
[YEAR] => '12/05-'16/06
[COUNT] => 6
)
[estima_50series_4] => Array
(
[NAME] => 50系
[NAMEEN] => 50series
[SHANAMEEN] => ESTIMA
[ORDER] => 90
[GRADE] => 全車対応
[MC] => 4期
[MODELYEAR] => '06/01-
[YEAR] => '16/06-
[COUNT] => 7
)
)
30系 '00/01-'06/01
50系 '06/01-