Sql Declare Array Variable Javascript Array Filter