查詢單據,卻不知道單據在當前表還是在歷史表
select * from wms_bill where ... union select * from wms_billhistory where ...
或者
if exists(select * from wms_bill where ..) begin select * from wms_bill where ... end else begin select * from wms_billhistory where ...
查詢單據,卻不知道單據在當前表還是在歷史表
select * from wms_bill where ... union select * from wms_billhistory where ...
或者
if exists(select * from wms_bill where ..) begin select * from wms_bill where ... end else begin select * from wms_billhistory where ...