Write a trigger to count orders for a product where the supplier has less than 3 products left.
CREATE FUNCTION count_order() RETURNS TRIGGER
LANGUAGE PLPGSQL
AS
$$
DECLARE
BEGIN
IF NEW.stock < 3 THEN
select COUNT(*) FROM Products;
END IF;
RETURN NEW;
END;
$$
create trigger count_order after insert on Products
for each row execute procedure count_order();
Kept getting error message. Please assist me where I am wrong "ERROR: query has no destination for result data HINT: If you want to discard the results of a SELECT, use PERFORM instead. CONTEXT: PL/pgSQL function count_order() line 5 at SQL statement"