From: Michal Ludvig Date: March 20 1999 7:03pm Subject: Re: Help with query, plz List-Archive: http://lists.mysql.com/mysql/696 Message-Id: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Sat, 20 Mar 1999, Ed Carp wrote: > > SELECT ip INTO temp_table > FROM table > GROUP BY ip > HAVING (((Count(ip))<>1)); > > SELECT Count(*) FROM temp_table; Hmm, my version of MySQL (3.22.19a) seems to support only "SELECT ip INTO OUTFILE xxx ...". What a pitty! Has it changed in 3.22.20? Well, it seems there is no other solution but "SELECT DISTINCT ip FROM table" and count the number of rows. I'm using Perl's DBI/DBD and there is no mysql_num_rows() [I think]. So how to do it? I hope not via a cycle "$i=0; while ($sth->fetchrow()) {$i++;}" ... Michal Ludvig