Thanks much,  I was trying to do it with subselects, like in MS SQL, but
obvioulsy that doesn't work with MySQL.  I like the temp table idea, the
table is deleted automatically when my mysql connection is closed, correct?
Thanks!


----- Original Message -----
From: "Braxton Robbason" <[EMAIL PROTECTED]>
To: "Jon Rosenberg" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Wednesday, May 02, 2001 1:48 PM
Subject: RE: select query question


> create temporary table foo as select patientnumber, count(*) as rcount
> from source_table
> group by patientnumber
> having count(*) > 1;
>
> select count(*) from foo;
>
> -----Original Message-----
> From: Jon Rosenberg [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 02, 2001 1:29 PM
> To: [EMAIL PROTECTED]
> Subject: select query question
>
>
> I have a table where patient visits are logged each visit, the table is:
>
> patientnumber,visitdate,location
>
> I need to select and count the number of records that have 2 or more
entries
> with the same patientnumber
>
> in sql-english:
> select count(*) where there are two or more records with the same
> patientnumber
>
> Any help with the SQL to do this would be much appreciated.  Thanks!
>
> Jon
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
> <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
>


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to