On Tue, 17 Apr 2001 12:34:27 -0700, Colin Putney
([EMAIL PROTECTED]) wrote:
>On Tuesday, April 17, 2001, at 12:19  PM, Mark Maggelet wrote:
>
>> That works for mysql. He probably just wants to kill the
>>duplicates,
>> so there's an easier way: add a unique index to the phone_number
>> field.
>>
>> alter ignore table $table add unique (phone_number);
>
>Yep, that will prevent duplicate phone numbers from being inserted
>into
>the table.
>
>Note that if there is existing data in the table, he'll have to
>remove
>the duplicates before making the phone_number field unique.

That would be true if I left out the 'ignore'. The way it is here it
will automatically toss the duplicates.

- Mark


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to