Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprende Uso del operador OR | Filtrado de Datos Avanzado
Introducción a SQL

book
Uso del operador OR

El operador OR se utiliza para filtrar registros basados en más de una condición, como si deseas devolver todos los países de Asia pero también aquellos de Europa:

Veamos el ejemplo:

SELECT name, population, continent, region
FROM country
WHERE continent='Asia' OR continent='Europe';
123
SELECT name, population, continent, region FROM country WHERE continent='Asia' OR continent='Europe';
copy

Here is the country table we are working with:

Tarea

Swipe to start coding

Write an SQL query to retrieve the name of the countries that are from 'Asia' or 'North America' continent.

Note

Note that north america is not the same as North America, and asia is not the same as Asia. Be careful and write correctly: North America and Asia.

Solución

SELECT name
FROM country
WHERE continent= 'Asia' OR continent = 'North America';
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 4. Capítulo 3

toggle bottom row
Query ResultQuery Result
No query executed yet...
some-alt