TDCustmerSupportJP Aug 1st, 2017 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- SELECT master_brand.code AS brand_code, master_brand.name AS brand_name, master_body.name AS body_name, model, COUNT(1) AS cnt
- FROM usedcar raw
- ( SELECT code, name, country_name FROM brand_master ) master_brand
- raw.code = master_brand.code
- ( SELECT code, name FROM body_master ) master_body
- raw.body_code = master_body.code
- WHERE master_brand.name = 'ポルシェ' AND master_body.name = 'オープン'
- GROUP BY master_brand.code, master_brand.name, master_body.name, model
- ORDER BY model
RAW Paste Data