From: Christian Mack
Date: March 12 1999 2:18pm
Subject: Re: Delete first found record in SQL select
List-Archive: http://lists.mysql.com/mysql/94
Message-Id: <36E92238.C472CF07@compal.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Jann Linder wrote:
>
> OS & PLATFORM: OH--forgot...using DBI w/perl 5 on Linux
>
> --QUESTION:
> I have a table with 3 fields.
>
> I have many records with IDENTICAL Fields.
>
> I want to pass the following:
>
> delete from tablename where a='a' and b='b' and c='c'
>
> and have the MySQL remove the FIRST RECORD ONLY where this criteria is met.
>
> How is this possible?
>
> HLP ASAP!
> Jann
>
> --
> Jann Linder
Hi Jann
You can do this with:
DELETE FROM tablename WHERE a='a' AND b='b' AND c='c' LIMIT 1
Note:
This only works with mysql.
Tschau
Christian