Otácio Barbosa, seSe você quiser usar o ALIAS você pode utilizar o HAVING..HAVING
.
A lógica dele é a mesma do WHEREWHERE
.
Ficando assim:
SELECT imp_loja AS LOJA, imp_item AS ITEM, imp_desc AS DESCRICAO, imp_dias_giro AS DIAS_DE_GIRO, imp_nec AS NECESSIDADE, imp_pedido AS PEDIDO, imp_bancao AS BANCAO, imp_romaneio AS ROMANEIO, imp_transito AS TRANSITO, imp_gondula AS GONDULA, imp_fator AS FATOR, imp_reposicao AS REPOSICAO, imp_estoque AS ESTOQUE, (imp_nec - imp_fator) AS NEC_FAT, (imp_estoque / imp_fator) AS EXT_X_FATOR, (imp_estoque + imp_transito) AS ESTTRAN, imp_data AS DATA FROM importacao HAVING ESTTRAN < 0 ORDER BY imp_desc
SELECT
imp_loja AS LOJA,
imp_item AS ITEM,
imp_desc AS DESCRICAO,
imp_dias_giro AS DIAS_DE_GIRO,
imp_nec AS NECESSIDADE,
imp_pedido AS PEDIDO,
imp_bancao AS BANCAO,
imp_romaneio AS ROMANEIO,
imp_transito AS TRANSITO,
imp_gondula AS GONDULA,
imp_fator AS FATOR,
imp_reposicao AS REPOSICAO,
imp_estoque AS ESTOQUE,
(imp_nec - imp_fator) AS NEC_FAT,
(imp_estoque / imp_fator) AS EXT_X_FATOR,
(imp_estoque + imp_transito) AS ESTTRAN,
imp_data AS DATA
FROM importacao HAVING ESTTRAN < 0 ORDER BY imp_desc