我想得到两个表的总和。
1-2.hospital_payment_data表数据
2-1.advenced_payment表
2-2 advenced_payment表数据
我想要结果
但是,发送查询结果如下。
SELECT COUNT(IF(treatment_fees_check_division = '선수금',
treatment_fees_check_division, NULL)) AS COUNT,
SUM(CASE WHEN treatment_fees_check_division = '선수금'
THEN treatment_fees_difference END) + SUM(advenced_amount
) AS if_treatment_fees_check_division,
SUM(advenced_amount) AS sum_init_amount
FROM
(
SELECT treatment_fees_check_division, treatment_fees_difference,
init_amount, advenced_amount
FROM hospital_payment_data , advenced_payment
)AS a
不良结果
如何解决查询?我想要你的姿势。
答案 0 :(得分:0)
这是您要寻找的吗?
A <- rep(1:10, each=2000)
x <- vector(mode = "list", length = 10000)
for (i in 1:length(A)) {
if (i<=length(x)) {
x[i] <- A[i]
}
else {
x <- c(x, A[i])
}
}