select b.mar_en_name, a.rd_name, a.shipto_code, a.inventory, a.twomonthtotalcost,
round(((inventory/twomonthtotalcost)*61) , 1) as InventoryDays, smmonth
from gl_distributor a, gl_et b
where a.mar_code=b.mar_code and twomonthtotalcost<>0 and
twomonthtotalcost is not null and hub_type_id=1 and smmonth='200609' order by inventorydays having inventorydays>100
round(((inventory/twomonthtotalcost)*61) , 1) as InventoryDays, smmonth
from gl_distributor a, gl_et b
where a.mar_code=b.mar_code and twomonthtotalcost<>0 and
twomonthtotalcost is not null and hub_type_id=1 and smmonth='200609' order by inventorydays having inventorydays>100
不可以这样,
select a.x m
from tab
where m < 0
round(((inventory/twomonthtotalcost)*61) , 1) as InventoryDays, smmonth
from gl_distributor a, gl_et b
where a.mar_code=b.mar_code and twomonthtotalcost<>0 and
twomonthtotalcost is not null and hub_type_id=1 and smmonth='200609' and inventorydays>100
order by round(((inventory/twomonthtotalcost)*61) , 1)