Reputation: 4278
I just saw an ad on YouTube for some dataviz software, with the following code :
SELECT * FROM foo WHERE bar @> '{"fizz", "buzz", "fizzbuzz"}'
which contains this @>
operator. It seems to be similar to the LIKE
operator, but I've never seen it used anywhere. Does it exist (is it specific to some SQL DBMS ?), and if so what does it do ?
Here is a screenshot of the ad (I covered the name of the brand) :
Thanks
Upvotes: 1
Views: 171
Reputation: 1140
This is the "contains" operator.
Check this for more: https://www.postgresql.org/docs/current/functions-matching.html
They are defined for other types as well for eg. Range @> int4range(0,3).
Upvotes: 0
Reputation: 1269933
The operator exists in Postgres. It is the "contains" operator to see if one array contains another.
The documentation is here.
Upvotes: 3