Advertisement
Tyler_Elric

Pokemon Species Summary

Mar 31st, 2012
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT
  2.  species.identifier AS 'id',
  3.  lang.name AS 'language',
  4.  (
  5.   SELECT species_entry.flavor_text
  6.   FROM pokemon_species_flavor_text AS 'species_entry'
  7.   WHERE species_entry.language_id==lang.language_id
  8.   OR species_entry.language_id==9
  9.   GROUP BY species_entry.species_id
  10.   HAVING species_entry.version_id==MAX(species_entry.version_id)
  11.  ) AS 'pkdx',
  12.  COALESCE((
  13.   SELECT species_names.name
  14.   FROM pokemon_species_names AS 'species_names'
  15.   WHERE
  16.    species_names.local_language_id==lang.language_id
  17.   AND
  18.    species_names.pokemon_species_id==species.id
  19.   ),(
  20.   SELECT 'EN:'||species_names.name
  21.   FROM pokemon_species_names AS 'species_names'
  22.   WHERE
  23.    species_names.local_language_id==9
  24.   AND
  25.    species_names.pokemon_species_id==species.id
  26.  )) AS 'name',
  27.  stats.identifier AS 'base',
  28.  (
  29.   SELECT pokemon_stats.base_stat
  30.   FROM pokemon_stats
  31.   WHERE
  32.    pokemon_stats.pokemon_id==species.id
  33.   AND
  34.    pokemon_stats.stat_id==stats.id
  35.  ) AS 'stat'
  36.  FROM
  37.   pokemon_species AS 'species'
  38.  JOIN stats
  39.  JOIN
  40.   language_names AS 'lang'
  41.  ORDER BY id ASC
  42. /* Use with Veekun's database! */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement