SQL> SELECT * FROM A; ID NAME 1 A1 2 A2 3 A3 SQL> SELECT * FROM C; ID AID NAME CODE NUM 1 1 B1 B 1 2 1 B2 B 3 3 2 C1 C 5 4 2 C2 C 7 5 3 D1 D 9 6 3 D2 D 2 7 3 D3 D 4 8 4 E1 E 6 9 4 E2 E 8 基于以上数据,下面SQL的模型如何调整() SQL> SELECT ID,NAME,(SELECT SUM(NUM) FROM C WHERE A.ID=C.AID) AS S FROM A ; ID NAME S 1 A1 4 2 A2 12 3 A3 15

区块链毕设网qklbishe.com为您提供问题的解答

SQL> SELECT * FROM A;

ID NAME
1 A1
2 A2
3 A3

SQL> SELECT * FROM C;

ID AID NAME CODE NUM
1 1 B1 B 1
2 1 B2 B 3
3 2 C1 C 5
4 2 C2 C 7
5 3 D1 D 9
6 3 D2 D 2
7 3 D3 D 4
8 4 E1 E 6
9 4 E2 E 8
基于以上数据,下面SQL的模型如何调整()

SQL> SELECT ID,NAME,(SELECT SUM(NUM) FROM C WHERE A.ID=C.AID) AS S FROM A ;

ID NAME S
1 A1 4
2 A2 12
3 A3 15

从业7年-专注一级市场


微信:btc9767
TELEGRAM :https://t.me/btcok9

具体资料介绍

web3的一级市场千万收益的逻辑


进群点我



qklbishe.com区块链毕设代做网专注|以太坊fabric-计算机|java|毕业设计|代做平台-javagopython毕设 » SQL> SELECT * FROM A; ID NAME 1 A1 2 A2 3 A3 SQL> SELECT * FROM C; ID AID NAME CODE NUM 1 1 B1 B 1 2 1 B2 B 3 3 2 C1 C 5 4 2 C2 C 7 5 3 D1 D 9 6 3 D2 D 2 7 3 D3 D 4 8 4 E1 E 6 9 4 E2 E 8 基于以上数据,下面SQL的模型如何调整() SQL> SELECT ID,NAME,(SELECT SUM(NUM) FROM C WHERE A.ID=C.AID) AS S FROM A ; ID NAME S 1 A1 4 2 A2 12 3 A3 15