SHARE
TWEET

Untitled

TDCustmerSupportJP Aug 1st, 2017 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT master_brand.code AS brand_code, master_brand.name AS brand_name, model, master_large_area.name AS large_area_name, COUNT(1) AS cnt
  2. FROM usedcar raw
  3. JOIN
  4. ( SELECT code, name, country_name FROM brand_master ) master_brand
  5. ON
  6. raw.code = master_brand.code
  7. JOIN
  8. ( SELECT code, name, large_area_code FROM pref_master ) master_pref
  9. ON
  10. raw.shop_pref_code = master_pref.code
  11. JOIN
  12. ( SELECT code, name FROM large_area_master ) master_large_area
  13. ON
  14. master_pref.large_area_code = master_large_area.code
  15. WHERE master_brand.name = 'ポルシェ' AND model = 'ボクスター'
  16. GROUP BY master_brand.code, master_brand.name, model, master_large_area.name
  17. ORDER BY large_area_name
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top