Aan de slagGa gratis aan de slag

Searching an ARRAY with @>

The contains operator @> operator is alternative syntax to the ANY function and matches data in an ARRAY using the following syntax.

WHERE array_name @> ARRAY['search text'] :: type[]

So let's practice using this operator in the exercise.

Deze oefening maakt deel uit van de cursus

Functions for Manipulating Data in PostgreSQL

Cursus bekijken

Oefeninstructies

  • Use the contains operator to match the text Deleted Scenes in the special_features column.

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

SELECT 
  title, 
  special_features 
FROM film 
-- Filter where special_features contains 'Deleted Scenes'
WHERE ___ ___ ARRAY['Deleted Scenes'];
Code bewerken en uitvoeren