I have the below table:
I'm trying to write some SQL to return Row ID
s (in pairs) where the below is true for two given rows:
Item
is equalName
is equalMeasure
is equalDates
overlap
So far what I have tried to do is use SELECT
, WHERE
& GROUP BY
to return Row ID
s (I'm aware this lacks the date functionality at present):
SELECT rowid FROM techtest GROUP BY Customer, Product, Measure;
However this returns individual Row ID
s 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?