数据库系统原理与实践——修复第四次作业中的错误
之前的代码的含义变成了“在2011、2019年等有交易记录”这个应该是错误的意思了,现在改正了。
This commit is contained in:
parent
0a60c93ef6
commit
527b98f61b
@ -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
|
||||
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[]{
|
||||
|
Loading…
Reference in New Issue
Block a user