AVG() 函数的使用

This commit is contained in:
GuanM 2024-11-19 15:27:11 +08:00
parent 9ccd5e1a89
commit 3fdd06a507

View File

@ -0,0 +1,13 @@
USE Mall
GO
SET NOCOUNT ON
------ return two columns that the price bigger than average price ------
-- ********** Begin ********** --
SELECT prod_name, prod_price
FROM Products
WHERE prod_price > (SELECT AVG(prod_price) FROM Products)
-- ********** End ********** --
GO