0
Come on, guys, I know my question might be silly... But how can I pull data from a field only in SQL. It’s just that I’m actually putting together a report of the company’s products... There are products that unit its value '1' but when it is sold in Box for example, becomes '0.98', understood? I wanted to do a following, It has a product that the unit is worth '1' and it being sold by box is also worth '1', so I ignore... But there is a product that the unit value of it is '1' but it sold in 'PT' or 'CX' (Depending on the product) the value of it goes down to '0.98' so I take this product 0.98 + the unit values that is '1' and if you have more sales unit as PT or DP (package and display) You take everything, too, you understand? I’ve done more complex things than that, but my head totally bugged, since yesterday thinking and nothing. Thank you. My Code is like this:
SELECT
produto.cd_prod,
produto.descricao,
unid_prod.qtde_unid,
unid_prod.fator_preco,
unid_vda
FROM
produto,
unid_prod
WHERE
unid_prod.cd_prod = produto.cd_prod
AND unid_prod.fator_preco = '0.9800'
Only in this case the query only pulls 0.9800 and ignores the rest of the sales units and I wanted that if it was 0.9800 it would bring the other units of measure together. I am New here, but already thank you.
factor_preco is a decimal or varchar field?
– Leonardo Bonetti
Do you want to determine a search for the value of a field? If yes, you can return other fields besides the field sought?
– Alexandre Cavaloti