Re: [SQL] SQL question....

2008-05-20 Thread Karl Denninger
Gurjeet Singh wrote: On Wed, May 21, 2008 at 4:47 AM, Karl Denninger <[EMAIL PROTECTED] > wrote: Gurjeet Singh wrote: On Tue, May 20, 2008 at 11:44 PM, Karl Denninger <[EMAIL PROTECTED]

Re: [SQL] SQL question....

2008-05-20 Thread Gurjeet Singh
On Wed, May 21, 2008 at 4:47 AM, Karl Denninger <[EMAIL PROTECTED]> wrote: > Gurjeet Singh wrote: > >> On Tue, May 20, 2008 at 11:44 PM, Karl Denninger <[EMAIL PROTECTED]> [EMAIL PROTECTED]>> wrote: >> >> assuming the following schema: >> >>create table access (name text, address ip) >

Re: [SQL] SQL question....

2008-05-20 Thread Karl Denninger
Gurjeet Singh wrote: On Tue, May 20, 2008 at 11:44 PM, Karl Denninger <[EMAIL PROTECTED] > wrote: assuming the following schema: create table access (name text, address ip) I want to construct a SELECT statement which will return ONLY tuples cont

Re: [SQL] SQL question....

2008-05-20 Thread Gurjeet Singh
On Tue, May 20, 2008 at 11:44 PM, Karl Denninger <[EMAIL PROTECTED]> wrote: > assuming the following schema: > > create table access (name text, address ip) > > I want to construct a SELECT statement which will return ONLY tuples > containing IP and name pairs IF there is an IP that has two o

Re: [SQL] SQL question....

2008-05-20 Thread Harold A. Giménez Ch.
I think this is what you're looking for: SELECT * FROM access WHERE ip IN(SELECT ip FROM access GROUP BY ip HAVING count(*) > 1) On Tue, May 20, 2008 at 3:17 PM, Karl Denninger <[EMAIL PROTECTED]> wrote: > chester c young wrote: > > create table access (name text, address ip) > > I

Re: [SQL] SQL question....

2008-05-20 Thread Karl Denninger
chester c young wrote: create table access (name text, address ip) I want to construct a SELECT statement which will return ONLY tuples containing IP and name pairs IF there is an IP that has two or more NAMEs associated with it. many ways: select a1.* from access a1 where exists(

Re: [SQL] SQL question....

2008-05-20 Thread chester c young
> create table access (name text, address ip) > > I want to construct a SELECT statement which will return ONLY tuples > containing IP and name pairs IF there is an IP that has two or more > NAMEs associated with it. > > many ways: select a1.* from access a1 where exists( select 1 from ac

[SQL] SQL question....

2008-05-20 Thread Karl Denninger
assuming the following schema: create table access (name text, address ip) I want to construct a SELECT statement which will return ONLY tuples containing IP and name pairs IF there is an IP that has two or more NAMEs associated with it. I've not figured out how to do this; I can get a