Re: [GENERAL] Search for lists

2011-06-19 Thread F. BROUARD / SQLpro
Le 18/06/2011 23:51, Daron Ryan a écrit : Hello, I need to search a table to find sets of rows that have a column matching itself for the whole set and another column matching row for row with a list I am going to supply. The result I should receive should be value of the column that matches

Re: [GENERAL] Search for lists

2011-06-19 Thread Gavin Flower
[...] I need to search a table to find sets of rows that have a column matching itself for the whole set and another column matching row for row with a list I am going to supply. The result I should receive should be value of the column that matches itself. [...] How about: DROP TABLE

[GENERAL] Search for lists

2011-06-18 Thread Daron Ryan
Hello, I need to search a table to find sets of rows that have a column matching itself for the whole set and another column matching row for row with a list I am going to supply. The result I should receive should be value of the column that matches itself. For example given the following

Re: [GENERAL] Search for lists

2011-06-18 Thread David Johnston
Untested approach Use array_agg on column 2 along with group by on column 1 to build check arrays and then use equals to compare with an array of your desired input values. You should omit duplicates and order ascending both the data and the input to ensure you are matching canonical forms.

Re: [GENERAL] Search for lists

2011-06-18 Thread David Johnston
An alternative approach would be to select using a IN condition on the where clause and group by column 1 and column 2. Then, using this as a sub-select group by the resultant column 1 and a count on column two. The matching identifiers are those with a count equal to the number of entries in

Re: [GENERAL] Search for lists

2011-06-18 Thread Daron Ryan
Thanks. On 19/06/2011 8:09 AM, David Johnston wrote: An alternative approach would be to select using a IN condition on the where clause and group by column 1 and column 2. Then, using this as a sub-select group by the resultant column 1 and a count on column two. The matching identifiers