Re: [sqlite] Selecting from a GROUP Select

2012-06-26 Thread Igor Tandetnik
On 6/26/2012 4:02 PM, Pavel Ivanov wrote: On Tue, Jun 26, 2012 at 3:02 PM, Igor Tandetnik wrote: On 6/26/2012 1:19 PM, Peter Haworth wrote: I still have the issue that, in order to be selected, the rows in the groups containing two entries must have a different value in a specific column.

Re: [sqlite] Selecting from a GROUP Select

2012-06-26 Thread Pavel Ivanov
On Tue, Jun 26, 2012 at 3:02 PM, Igor Tandetnik wrote: > On 6/26/2012 1:19 PM, Peter Haworth wrote: >> >> I still have the issue that, in order to be selected,  the rows in the >> groups containing two entries must have a different value in a specific >> column. > > > I'm not quite sure I understa

Re: [sqlite] Selecting from a GROUP Select

2012-06-26 Thread Igor Tandetnik
On 6/26/2012 1:19 PM, Peter Haworth wrote: I still have the issue that, in order to be selected, the rows in the groups containing two entries must have a different value in a specific column. I'm not quite sure I understand the condition, but perhaps you are looking for something like this:

Re: [sqlite] Selecting from a GROUP Select

2012-06-26 Thread Pavel Ivanov
http://www.lcsql.com> > > > > On Sat, Jun 23, 2012 at 9:00 AM, wrote: > >> Message: 5 >> Date: Fri, 22 Jun 2012 19:17:39 -0400 >> From: Pavel Ivanov >> To: General Discussion of SQLite Database >> Subject: Re: [sqlite] Selecting from a GROUP Sele

Re: [sqlite] Selecting from a GROUP Select

2012-06-26 Thread Peter Haworth
vanov > To: General Discussion of SQLite Database > Subject: Re: [sqlite] Selecting from a GROUP Select > Message-ID: > > > Content-Type: text/plain; charset=ISO-8859-1 > > I guess you need something like > > SELECT * from TableA > WHERE z in ( > SELECT z F

Re: [sqlite] Selecting from a GROUP Select

2012-06-22 Thread Pavel Ivanov
I guess you need something like SELECT * from TableA WHERE z in ( SELECT z FROM TableA GROUP BY z HAVING count(*)=2 ); Pavel On Fri, Jun 22, 2012 at 6:43 PM, Peter Haworth wrote: > I have a situation where I need to select entries based on the count of the > number of entries in a GROUP = 2,

[sqlite] Selecting from a GROUP Select

2012-06-22 Thread Peter Haworth
I have a situation where I need to select entries based on the count of the number of entries in a GROUP = 2, and also that the value of a specific column must be different for each row in the group. I then need to select all the individual rows from the qualifying groups. Getting the groups with