Tag Info

New answers tagged

6

Sounds like a simple cross join: select a.id, b.id from input_table a cross join input_table b where a.id <> b.id;


2

I agree with oNare that adding a sqlFiddle that builds a simplified version of your data model, shows what you have tried so far, and shows the desired results would be most helpful. That said, you might want something like the following in order to avoid double-counting the sales for any customers that were given multiple offers. I've put inline comments ...



Top 50 recent answers are included