From 527b98f61b30d92131cbfea6ce73eefd5983ad32 Mon Sep 17 00:00:00 2001 From: 423A35C7 <609514299@qq.com> Date: Sun, 20 Oct 2024 18:40:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E5=8E=9F=E7=90=86=E4=B8=8E=E5=AE=9E=E8=B7=B5=E2=80=94=E2=80=94?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=AC=AC=E5=9B=9B=E6=AC=A1=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 之前的代码的含义变成了“在2011、2019年等有交易记录”这个应该是错误的意思了,现在改正了。 --- 数据库系统原理与实践/平时作业/第四次作业.tex | 47 +++++++++++--------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/数据库系统原理与实践/平时作业/第四次作业.tex b/数据库系统原理与实践/平时作业/第四次作业.tex index d9baded..cfff4ce 100644 --- a/数据库系统原理与实践/平时作业/第四次作业.tex +++ b/数据库系统原理与实践/平时作业/第四次作业.tex @@ -230,32 +230,35 @@ where not not exists(select * from account where PRODUCT_CD = 'CS' and account.C 其他年无交易记录,不要,要 \end{csv} \begin{minted}{SQL} -select ACCOUNT_ID +select account.ACCOUNT_ID from account - left join (select * + left join (select ACCOUNT_ID from acc_transaction - where year(TXN_DATE) != 2013) as not2013 using (ACCOUNT_ID) -where TXN_DATE is not null; + where year(TXN_DATE) = 2013) as _2013 on account.ACCOUNT_ID = _2013.ACCOUNT_ID +where _2013.ACCOUNT_ID is null +order by account.ACCOUNT_ID; \end{minted} - \begin{csv} + \small\begin{csv} ,ACCOUNT_ID -1,4 -2,5 -3,18 -4,19 -5,21 -6,28 -7,10 -8,17 -9,13 -10,29 -11,27 -12,3 -13,23 -14,12 -15,22 -16,15 -17,28 +1,1 +2,2 +3,3 +4,5 +5,10 +6,11 +7,12 +8,13 +9,15 +10,17 +11,18 +12,19 +13,21 +14,22 +15,23 +16,27 +17,28 +18,29 +19,30 \end{csv} } \questionandanswer[]{