数据库系统原理与实践——修复第四次作业中的错误
原先的表达式含义是只能购买RS或CS而没买别的,新的含义才是同时购买RS和CS。
This commit is contained in:
parent
2a10a2adc5
commit
0a60c93ef6
@ -198,16 +198,17 @@ from (select account.ACCOUNT_ID, OPEN_BRANCH_ID, AVAIL_BALANCE, max_avail_balanc
|
||||
\begin{minted}{SQL}
|
||||
select individual.ID_NUMBER 身份证号, concat(individual.LAST_NAME, individual.FIRST_NAME) 姓名全名
|
||||
from individual
|
||||
where not exists(select *
|
||||
from account
|
||||
where PRODUCT_CD != 'CS' and PRODUCT_CD != 'RS' and account.CUST_ID = individual.CUST_ID);
|
||||
where not not exists(select * from account where PRODUCT_CD = 'CS' and account.CUST_ID = individual.CUST_ID)
|
||||
and not not exists(select * from account where PRODUCT_CD = 'RS' and account.CUST_ID = individual.CUST_ID);
|
||||
\end{minted}
|
||||
\begin{csv}
|
||||
,身份证号,姓名全名
|
||||
1,41032619780815564X,许文强
|
||||
2,370900196802069281,何婕
|
||||
3,320623197108259227,施珊珊
|
||||
4,321111197703197600,孔庆东
|
||||
1,350403198204222299,尤青
|
||||
2,41032619780815564X,许文强
|
||||
3,370900196802069281,何婕
|
||||
4,450881196612220768,吕东
|
||||
5,320623197806169227,严匡
|
||||
6,320623197108259227,施珊珊
|
||||
\end{csv}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user