count(distinct a.od_id) as ordercount,
count(b.ct_id) as itemcount,
(SUM(b.ct_amount * b.ct_qty) + a.od_send_cost) as orderamount ,
(SUM(IF(b.ct_status = '취소' OR b.ct_status = '반품' OR b.ct_status = '품절', b.ct_amount * b.ct_qty, 0))) as ordercancel,
(a.od_receipt_bank + a.od_receipt_card + a.od_receipt_hp + a.od_receipt_point) as receiptamount,
(a.od_refund_amount + a.od_cancel_card) as receiptcancel,
(
(SUM(b.ct_amount * b.ct_qty) + a.od_send_cost) -
(SUM(IF(b.ct_status = '취소' OR b.ct_status = '반품' OR b.ct_status = '품절', b.ct_amount * b.ct_qty, 0))) -
a.od_dc_amount -
(a.od_receipt_bank + a.od_receipt_card + a.od_receipt_hp + a.od_receipt_point) +
(a.od_refund_amount + a.od_cancel_card)
) as misu ");
>>
미배송건 쿼리 보니 토나오네요.. 흑흑
취소한것도 미배송에 나오는데요 안나오게 할려면 어떻게 하면 좋을까요??
count(b.ct_id) as itemcount,
(SUM(b.ct_amount * b.ct_qty) + a.od_send_cost) as orderamount ,
(SUM(IF(b.ct_status = '취소' OR b.ct_status = '반품' OR b.ct_status = '품절', b.ct_amount * b.ct_qty, 0))) as ordercancel,
(a.od_receipt_bank + a.od_receipt_card + a.od_receipt_hp + a.od_receipt_point) as receiptamount,
(a.od_refund_amount + a.od_cancel_card) as receiptcancel,
(
(SUM(b.ct_amount * b.ct_qty) + a.od_send_cost) -
(SUM(IF(b.ct_status = '취소' OR b.ct_status = '반품' OR b.ct_status = '품절', b.ct_amount * b.ct_qty, 0))) -
a.od_dc_amount -
(a.od_receipt_bank + a.od_receipt_card + a.od_receipt_hp + a.od_receipt_point) +
(a.od_refund_amount + a.od_cancel_card)
) as misu ");
>>
미배송건 쿼리 보니 토나오네요.. 흑흑
취소한것도 미배송에 나오는데요 안나오게 할려면 어떻게 하면 좋을까요??
게시글 목록
| 번호 | 제목 |
|---|---|
| 284438 | |
| 284437 | |
| 284435 | |
| 284430 | |
| 284420 | |
| 284417 | |
| 284409 | |
| 284401 | |
| 284399 | |
| 284397 | |
| 284380 | |
| 284378 | |
| 284371 | |
| 284370 | |
| 284366 | |
| 284364 | |
| 284360 | |
| 284357 | |
| 284355 | |
| 284354 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기