Team,
Need your help for my analysis.
Attached scenario is the price comparison between three products Apple, Orange and Mango are available in my product table date wise
There is a price difference between previous day and the current day and the same is captured as Plus and Minus for each product day wise
Now the requirement is given below,
Need to compare each day's "Sign" of every product with the 2 other product and find out which pattern suits my requirement
Eg., Apple --> Orange
Current date's "Sign" needs to be compared with the previous date's "Sign"
Orange - 03-Aug-18 - "Minus", has to be compared with Apple 02-Aug-18 - "Minus"
As per my requirement orange is matched with apple, 3rd aug Minus sign is matched with 2nd Aug Minus sign,4rd aug Plus sign is in 3nd Aug Plus sign,5th aug Plus sign is in 4th Aug Plus sign.
Like wise need to compare each product with the other two
Apple --> Orange Signs
Apple --> Mango Signs
Orange --> Apple Signs
Orange --> Mango Signs
Mango --> Apple signs
Mango --> Orange signs
I wanted the above example to be written in a SQL Query where the query will output my requirement.
thanks
Jay