1

有人可以帮我弄这个吗。我正在使用 SQL 开发人员。

说这是我的查询

select
ac.customer_name, 
acra.receipt_number,
acra.receipt_amount amount_value,
rcta.trx_number,
rcta.attribute5 as office_code
from
ar_customers ac,
ar_cash_receipts_all acra,
ra_customer_trx_all rcta
where
ac.customer_id=acra.customer_id and
acra.cash_receipt_id = rcta.cash_receipt_id and
acra.receipt_amount > 5000;

在这个输出中,我想添加一个应该包含值 1 的列 stamp_value 。怎么做?

4

1 回答 1

0

这是你需要的吗?

SELECT CASE WHEN amount_value > 5000 THEN 1
            ELSE NULL
       END stamp_value
  FROM t1 JOIN t2 ...
于 2012-07-01T15:42:08.133 回答