Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

Create Procedure

DELIMITER //
 CREATE PROCEDURE GetTop10Customers()
   BEGIN
	SELECT c.first_name, c.last_name, SUM(p.amount) as total_payments
	FROM customer c
	JOIN payment p
		ON c.customer_id = p.customer_id
	GROUP BY c.customer_id
	ORDER BY total_payments DESC
	limit 10;
   END //
 DELIMITER ;
Source by platform.codingnomads.co #
 
PREVIOUS NEXT
Tagged: #Create #Procedure
ADD COMMENT
Topic
Name
7+6 =