-
-
Save tearf001/e785de2640912725827516c61d478a81 to your computer and use it in GitHub Desktop.
返回匿名表
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE FUNCTION extended_sales(p_itemno int) | |
RETURNS TABLE(quantity int, total numeric) AS $$ | |
BEGIN | |
RETURN QUERY SELECT s.quantity, s.quantity * s.price FROM sales AS s | |
WHERE s.itemno = p_itemno; | |
END; | |
$$ LANGUAGE plpgsql; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment