Advertisement
Tyler_Elric

Pokemon Species Summary

Mar 31st, 2012
124
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.  COALESCE((
  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.   GROUP BY species_entry.species_id
  9.   HAVING species_entry.version_id==MAX(species_entry.version_id)
  10.  ),(
  11.   SELECT 'EN:'||species_entry.flavor_text
  12.   FROM pokemon_species_flavor_text AS 'species_entry'
  13.   WHERE species_entry.language_id==9
  14.   GROUP BY species_entry.species_id
  15.   HAVING species_entry.version_id==MAX(species_entry.version_id)
  16. )) AS 'pkdx',
  17.  COALESCE((
  18.   SELECT species_names.name
  19.   FROM pokemon_species_names AS 'species_names'
  20.   WHERE
  21.    species_names.local_language_id==lang.language_id
  22.   AND
  23.    species_names.pokemon_species_id==species.id
  24.   ),(
  25.   SELECT 'EN:'||species_names.name
  26.   FROM pokemon_species_names AS 'species_names'
  27.   WHERE
  28.    species_names.local_language_id==9
  29.   AND
  30.    species_names.pokemon_species_id==species.id
  31.  )) AS 'name',
  32.  stats.identifier AS 'base',
  33.  (
  34.   SELECT pokemon_stats.base_stat
  35.   FROM pokemon_stats
  36.   WHERE
  37.    pokemon_stats.pokemon_id==species.id
  38.   AND
  39.    pokemon_stats.stat_id==stats.id
  40.  ) AS 'stat'
  41.  FROM
  42.   pokemon_species AS 'species'
  43.  JOIN stats
  44.  JOIN
  45.   language_names AS 'lang'
  46.  WHERE stats.is_battle_only==0
  47.  ORDER BY id ASC
  48. /* Use with Veekun's database! */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement