查询单据,却不知道单据在当前表还是在历史表
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 ...