JSON_ARRAY_EXCEPT (Lakehouse v1)
Renvoie un nouveau tableau JSON contenant les éléments du premier tableau JSON qui ne figurent pas dans le second.
Syntaxe SQL
Section intitulée « Syntaxe SQL »JSON_ARRAY_EXCEPT(<json_array1>, <json_array2>)Type de retour
Section intitulée « Type de retour »Tableau JSON.
Exemples SQL
Section intitulée « Exemples SQL »SELECT JSON_ARRAY_EXCEPT( '["apple", "banana", "orange"]'::JSON, '["banana", "grapes"]'::JSON);
-[ RECORD 1 ]-----------------------------------json_array_except('["apple", "banana", "orange"]'::VARIANT, '["banana", "grapes"]'::VARIANT): ["apple","orange"]
-- Return an empty array because all elements in the first array are present in the second array.SELECT json_array_except('["apple", "banana", "orange"]'::VARIANT, '["apple", "banana", "orange"]'::VARIANT)
-[ RECORD 1 ]-----------------------------------json_array_except('["apple", "banana", "orange"]'::VARIANT, '["apple", "banana", "orange"]'::VARIANT): []