3
Is there any way to put several values for a column in WHERE
?
For example product A was replaced by product B,
product 2933 for the 4044, product 2599 for 7845, and product 5987 by 9432.
Example:
where DepartureDate between '20161120' and '20161120'
AND datediff(day, DataVersao, DepartureDate) between 0 and 100
and Segment = 'VCPCNF'
and Produto in ('2933','4044')
and Produto in ('5987','9432')
and Produto in ('2599','7845')
What happens is I have 30 days of product sale 2933 But on the tenth day he changes his number code to 4044. When I put it on a chart to analyze the sales results, I have half on 2933 and half on 4044. Give me together the two results and Product in ('2933','4044') and I have complete.
But in my case, I want it to bring the result of product 2933 that was replaced by product 4044. Then bring the result of the product 5987 which was replaced by the result of the number 9432. Then bring the product result 2599 which was replaced by the result of the number 7845. Bring at once without having to run around one by one. So I separated as ('2933','4044'), ('5987','9432') and ('2599','7845')
You got a problem doing this?
– Maniero
You have to exchange for ( Product IN ... OR Product IN ... ) the current condition cannot be true (or ideally one IN only)
– Bacco
Yeah, first of all, it doesn’t work and it doesn’t carry the values. According to I want it to bring in a table only the values of the product A that was replaced by Product B. So it will bring me values of '2933', '5987', '2599' but these replaced the second number within the parentheses.
– Thais