I have a table with the following columns:
a|b|c|d|e
and I want to select all the records such that a combination of a subset of the columns is repeated (say, a, b, c). Example:
a|b|c|d|e
1|2|3|1|2
6|7|8|9|1
1|2|3|4|5
1|2|2|5|4
should result in:
1|2|3|1|2
1|2|3|4|5
This will do it:
A second way (SQLite does not support
(x,y) in (select two columns)):A third way:
This last one has an advantage, you can also add aggregate rows (like if you used analytic functions in other RDBMS:)
which is similar to this in Oracle: