苯
苯苯
Unregistered / Unconfirmed
GUEST, unregistred user!
现在有两个表:
branch.db
arae char(4)
branchname char(20)
oper.db
area char(4)
total numberic
delay numberic
userid char(8)
假设branch.db的数据为:
X X_name
Z01 Z01_name
Z02 Z02_name
M M_name
oper.db为操作情况表假设有如下的数据
oper.db
area total delay userid
-----------------------------
X 100.0 2.3 abcd
X 50.6 0 abcd
Z01 200.9 3.5 abcd
Z01 300 5 abcd
Z01 130.0 3 Eric
Z02 140.8 10.4 Eric
Z02 140.8 10.4 abcd
Z02 250.0 30.5 Eric
得到的结果为:userid='abcd'的统计数据:即为:
X_name 150.6 2.3
Z01_name 500.9 8.5
Z02_name 140.8 10.4
请问SQL语句怎么写?
branch.db
arae char(4)
branchname char(20)
oper.db
area char(4)
total numberic
delay numberic
userid char(8)
假设branch.db的数据为:
X X_name
Z01 Z01_name
Z02 Z02_name
M M_name
oper.db为操作情况表假设有如下的数据
oper.db
area total delay userid
-----------------------------
X 100.0 2.3 abcd
X 50.6 0 abcd
Z01 200.9 3.5 abcd
Z01 300 5 abcd
Z01 130.0 3 Eric
Z02 140.8 10.4 Eric
Z02 140.8 10.4 abcd
Z02 250.0 30.5 Eric
得到的结果为:userid='abcd'的统计数据:即为:
X_name 150.6 2.3
Z01_name 500.9 8.5
Z02_name 140.8 10.4
请问SQL语句怎么写?