I think this is what you're looking for:<br /><br />SELECT * FROM access <br /> WHERE ip IN(SELECT ip FROM access <br
/> GROUP BY ip HAVING count(*) > 1)<br /><br /><div class="gmail_quote">On Tue, May 20, 2008 at 3:17 PM, Karl
Denninger<<a href="mailto:karl@denninger.net">karl@denninger.net</a>> wrote:<br /><blockquote class="gmail_quote"
style="border-left:1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div bgcolor="#ffffff"
text="#000000">chester c young wrote: <blockquote type="cite"><blockquote type="cite"><pre>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.
</pre></blockquote><pre>many ways:
select a1.* from access a1 where exists( select 1 from access a2 where <a href="http://a2.name"
target="_blank">a2.name</a>=<ahref="http://a2.name" target="_blank">a2.name</a> and a1.ip!=a2.ip );
select a1.*
from access a1
join access a2 using( name )
where a1.ip != a2.ip;
</pre></blockquote> Those will return single entries as well (which is easy to do with an "ORDER BY", that is
computationallysimpler)<br /><br /> What I want (and can't figure out) is a SELECT that returns ONLY tuples with two or
moreNAME entries that have the same IP.<br /><br /> -- Karl<br /></div></blockquote></div><br />