TOYOTA Vitz
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 ='vitz' AND KAT.HYOJIFLG = 1 ORDER BY NENSHIKIFR,NENSHIKITO, MC,GRADE
Array
(
[vitz_130series_2] => Array
(
[NAME] => 90系
[NAMEEN] => 90series
[SHANAMEEN] => Vitz
[ORDER] => 90
[GRADE] => U,X,F,B
[MC] => MC前
[MODELYEAR] => '05/02-'10/12
[YEAR] => '05/02-'07/08
[COUNT] => 0
)
[vitz_130series_1] => Array
(
[NAME] => 90系
[NAMEEN] => 90series
[SHANAMEEN] => Vitz
[ORDER] => 90
[GRADE] => RS
[MC] => MC前
[MODELYEAR] => '05/02-'10/12
[YEAR] => '05/02-'08/09
[COUNT] => 1
)
[vitz_90series_2] => Array
(
[NAME] => 90系
[NAMEEN] => 90series
[SHANAMEEN] => Vitz
[ORDER] => 90
[GRADE] => 全車対応
[MC] => MC後
[MODELYEAR] => '05/02-'10/12
[YEAR] => '08/09-'10/12
[COUNT] => 2
)
[vitz_90series_3] => Array
(
[NAME] => 130系
[NAMEEN] => 130series
[SHANAMEEN] => Vitz
[ORDER] => 90
[GRADE] => 全車対応
[MC] => 前期
[MODELYEAR] => '10/12-
[YEAR] => '10/12-'14/04
[COUNT] => 3
)
[vitz_130series_4] => Array
(
[NAME] => 130系
[NAMEEN] => 130series
[SHANAMEEN] => Vitz
[ORDER] => 90
[GRADE] => 全車対応
[MC] => 中期
[MODELYEAR] => '10/12-
[YEAR] => '14/04-'17/01
[COUNT] => 4
)
[vitz_90series_5] => Array
(
[NAME] => 130系
[NAMEEN] => 130series
[SHANAMEEN] => Vitz
[ORDER] => 90
[GRADE] => 全車対応
[MC] => 後期
[MODELYEAR] => '10/12-
[YEAR] => '17/01-
[COUNT] => 5
)
)
90系 '05/02-'10/12
130系 '10/12-