$ ./sql 'select * from descuentos where categoria="CF"' +---------+-------+-----------+-------+-------+ | id | grupo | categoria | medio | dto | +---------+-------+-----------+-------+-------+ | 4512495 | 119 | CF | 1 | 10.00 | | 4512496 | 119 | CF | 2 | 10.00 | +---------+-------+-----------+-------+-------+ ^------- need to put this thing $ ./sql 'select id, presea_grupo_dto, dto_promocional_cf from productos where presea_grupo_dto=119' +------+------------------+--------------------+ | id | presea_grupo_dto | dto_promocional_cf | +------+------------------+--------------------+ | 4791 | 119 | 0.00 | +------+------------------+--------------------+ ^--------- here