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