쿼리질문입니다. 0 1 108

by darkload [SQL Query] [2018.01.05 16:14:47]


이쿼리랑 이쿼리를 합칠수있을까요?

as B on A.item_code = b.item_code
    where a.chgo_date >= :bDATE and a.chgo_date <= :bDATE2 and
        a.item_type like :bitem_type and a.cust_cod like ::bcust_code

 

select b.cust_name,c.item_name,A.item_type, A.chgo_date,A.cust_code,A.item_code,A.chgo_qnty,A.chgo_dann,A.chgo_amnt,(chgo_amnt*0.1) as chgo_vats,
       (A.chgo_amnt+(chgo_amnt*0.1)) as AMNT_VATS,(chgo_amnt) as TOTA_AMNT,(chgo_amnt*0.1) as TOTA_VATS,(A.chgo_amnt+(chgo_amnt*0.1)) as AMNT_VATSS
   from ITEM_CHGO as  A with(nolock)
       left join
       CUST_INFO B
    on a.cust_code = b.cust_Code
    left join
       item_info c
       on a.item_code = c.item_code
   where a.cust_code = '0009'

by 마농 [2018.01.08 08:37:26]
SELECT b.cust_name
     , c.item_name
     , A.item_type
     , A.chgo_date
     , A.cust_code
     , A.item_code
     , A.chgo_qnty
     , A.chgo_dann
     , A.chgo_amnt
     , (chgo_amnt*0.1) as chgo_vats
     , (A.chgo_amnt+(chgo_amnt*0.1)) as AMNT_VATS
     , (chgo_amnt) as TOTA_AMNT
     , (chgo_amnt*0.1) as TOTA_VATS
     , (A.chgo_amnt+(chgo_amnt*0.1)) as AMNT_VATSS
  FROM item_chgo AS A with(nolock)
  LEFT JOIN cust_info b
    ON a.cust_code = b.cust_Code
  LEFT JOIN item_info c
    ON a.item_code = c.item_code
 WHERE a.cust_code = '0009'
   AND a.chgo_date >= :bDATE
   AND a.chgo_date <= :bDATE2
   AND a.item_type LIKE :bitem_type
   AND a.cust_cod  LIKE :bcust_code
;

 

댓글등록
SQL문을 포맷에 맞게(깔끔하게) 등록하려면 code() 버튼을 클릭하여 작성 하시면 됩니다.
로그인 사용자만 댓글을 작성 할 수 있습니다. 로그인, 회원가입