programming-examples/sql/RetrieveFromTables/Write a SQL query to show the winners of a 'Physiology' prize in an early year before 1971 together with winners of a 'Peace' prize in a later year on and after the 1974.sql

9 lines
348 B
MySQL
Raw Normal View History

2019-11-18 14:05:53 +01:00
/* Write a SQL query to show the winners of a 'Physiology' prize in an early year before 1971 together with winners of
a 'Peace' prize in a later year on and after the 1974.*/
SELECT *
FROM nobel_win
WHERE (subject ='Physiology' AND year<1971)
UNION
SELECT *
FROM nobel_win
WHERE (subject ='Peace' AND year>=1974);