数据库系统原理与实践——修复第四次作业中的错误
原先的表达式含义是只能购买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}
|
\begin{minted}{SQL}
|
||||||
select individual.ID_NUMBER 身份证号, concat(individual.LAST_NAME, individual.FIRST_NAME) 姓名全名
|
select individual.ID_NUMBER 身份证号, concat(individual.LAST_NAME, individual.FIRST_NAME) 姓名全名
|
||||||
from individual
|
from individual
|
||||||
where not exists(select *
|
where not not exists(select * from account where PRODUCT_CD = 'CS' and account.CUST_ID = individual.CUST_ID)
|
||||||
from account
|
and not not exists(select * from account where PRODUCT_CD = 'RS' and account.CUST_ID = individual.CUST_ID);
|
||||||
where PRODUCT_CD != 'CS' and PRODUCT_CD != 'RS' and account.CUST_ID = individual.CUST_ID);
|
|
||||||
\end{minted}
|
\end{minted}
|
||||||
\begin{csv}
|
\begin{csv}
|
||||||
,身份证号,姓名全名
|
,身份证号,姓名全名
|
||||||
1,41032619780815564X,许文强
|
1,350403198204222299,尤青
|
||||||
2,370900196802069281,何婕
|
2,41032619780815564X,许文强
|
||||||
3,320623197108259227,施珊珊
|
3,370900196802069281,何婕
|
||||||
4,321111197703197600,孔庆东
|
4,450881196612220768,吕东
|
||||||
|
5,320623197806169227,严匡
|
||||||
|
6,320623197108259227,施珊珊
|
||||||
\end{csv}
|
\end{csv}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user