Some additional logical operators are NOT, IN, and BETWEEN:
- IN allows you to list the values that you want to return in your query results. For instance, if you want to return any values in g_all (all games played) that are in 40, 50, or 60, you could run the following query:
USE lahmansbaseballdb;SELECT playerid, g_all, g_batting, g_defense FROM appearancesWHERE g_all IN (40, 50, 60);
- BETWEEN allows you to list two values, and your query will return all the values between and including those values. For instance, if you want to return any values in g_all that are between 40 and 60, you could run the following query:
USE lahmansbaseballdb;SELECT playerid, g_all, g_batting, g_defense ...