表结构如下:
Sales: Sales_id, sDate,ccode,qty,amt;
Challan: Ch_id, ch_date,qty,amt;
所需资料为:
Id | Date | CCode | Type | Qty | Amt
If sales then type = sales; if challan then type = challan ; order by date
我尝试了以下方法:
select s.cust_code,s.cust_name,s.sales_qty,s.sales_amt,c.cust_code,
c.cust_name,c.challan_qty ,c.challan_amt
from sales s inner
join challan c on s.sales_date = c.challan_date
我应该如何放置自定义类型的列并在特定日期显示挑战或销售?