I have the below table:
I'm trying to write some SQL to return Row IDs (in pairs) where the below is true for two given rows:
Itemis equalNameis equalMeasureis equalDatesoverlap
So far what I have tried to do is use SELECT, WHERE & GROUP BY to return Row IDs (I'm aware this lacks the date functionality at present):
SELECT rowid FROM techtest GROUP BY Customer, Product, Measure;
However this returns individual Row IDs instead of pairs. For example what I hope to get as a return is Row ID 1 & 2 together, as they meet all of the criteria listed.
How would I go about writing this to return a list of pairs of rows which meet the criteria listed?
