Matches in a database.

Tyler Strickland tyler at tylers.org
Tue Jun 28 11:52:14 MDT 2005


Matthew Walker wrote:
> On Tue, 2005-06-28 at 11:20 -0600, C. Ed Felt wrote:
> 
>>So, in short, (since a paragraph will get confusing):
>>
>>1.  SELECT all records in the CDR table after a requested date (usually 
>>24 hours).
>>2.  Store these records in a huge array.
>>3.  Find all repeats on the 'sessid' field and store this in an array.
>>4.  Delete all repeats (save one copy of each repeat CDR).
>>
>>Is there a MySQL query, (version 3), to select all rows that have one or 
>>more matching rows on a specific field ('sessid')?  This would 
>>essentially combine steps 1, 2 and 3 in one MySQL query.
> 
> 
> I don't believe this is doable in a single query until MySQL 5.
> You /might/ be able to do it in 4.1, but I'm not sure.

Yeah, not having subselects makes this sort of thing a _bit_ more 
complicated, if not downright impossible to do in a single query.

Tyler



More information about the PLUG mailing list