SQL select from table where multiple entries exist

0

I have a database of info from the pokemon games. One of the tables contains the moves that can be learned by each pokemon. How can I select from this table where a pokemon can learn both of two moves?

My current query is SELECT * FROM 'learned-moves' WHERE 'Version Group'=? AND ('Move'=? OR 'Move'=?); but this selects all rows that contain either move. How can I only return those rows if they both match?

edit: db schema

sql
2021-11-24 02:59:35
1

0

Consider an INNER JOIN on itself or self-join:

SELECT l1.Pokemon, l1.'Move' AS 'Move1', l2.'Move' AS 'Move2'
FROM 'learned-moves' l1
INNER JOIN 'learned-moves' l2
  ON l2.Pokemon = l1.Pokemon
  AND l2.'Version Group' = l1.'Version Group'
  AND l1.'Version Group' = ?
  AND l1.'Move' = ?
  AND l2.'Move' = ?
2021-11-24 03:40:48

In other languages

This page is in other languages

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................