From 3fdd06a507dc2e67bd04558f8c1b7b6701124a0c Mon Sep 17 00:00:00 2001 From: GuanM <30427262+sxhoio@users.noreply.github.com.> Date: Tue, 19 Nov 2024 15:27:11 +0800 Subject: [PATCH] =?UTF-8?q?AVG()=20=E5=87=BD=E6=95=B0=E7=9A=84=E4=BD=BF?= =?UTF-8?q?=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 数据库/头歌/AVG() 函数的使用/AVG() 函数的使用.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 数据库/头歌/AVG() 函数的使用/AVG() 函数的使用.sh diff --git a/数据库/头歌/AVG() 函数的使用/AVG() 函数的使用.sh b/数据库/头歌/AVG() 函数的使用/AVG() 函数的使用.sh new file mode 100644 index 0000000..b86a9e6 --- /dev/null +++ b/数据库/头歌/AVG() 函数的使用/AVG() 函数的使用.sh @@ -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 \ No newline at end of file