sargol
sargol

Reputation: 65

remove a member of array in postgresql

In Postgresql, if I have an array of team_id in my table for example team_id=[2,3,5,7] when I want to remove 7 from the array of team_id what is the command?

I write :

SELECT array_remove(ARRAY[team_id],7)

but it is not correct

Upvotes: 1

Views: 36

Answers (1)

Gordon Linoff
Gordon Linoff

Reputation: 1271151

The array keyword is unnecessary:

select array_remove(team_id, 7)

Upvotes: 2

Related Questions