select full_name from cust_info inner join item_chgo on item_chgo.cust_code=cust_info.cust_code where cust_info.cust_code= '0009' select chgo_date,cust_code,item_code,chgo_qnty,chgo_dann,chgo_amnt from item_chgo where cust_code=(select cust_code from cust_info where cust_code='0009') select item_name from item_info inner join item_chgo on item_chgo.item_code=item_info.item_code where item_chgo.item_code= '1801106'
각각의 쿼리를 하나로 합칠수는 없나요?
SELECT a.chgo_date , a.cust_code , b.full_name cust_name , a.item_code , c.item_name , a.chgo_qnty , a.chgo_dann , a.chgo_amnt FROM item_chgo a INNER JOIN cust_info b ON a.cust_code = b.cust_code INNER JOIN item_info c ON a.item_code = c.item_code WHERE a.cust_code = '0009' AND a.item_code = '1801106' ;