List:General Discussion« Previous MessageNext Message »
From:Christian Mack Date:March 12 1999 2:18pm
Subject:Re: Delete first found record in SQL select
View as plain text  
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

Thread
Delete first found record in SQL selectJann Linder12 Mar
  • Re: Delete first found record in SQL selectChristian Mack12 Mar
  • RE: Delete first found record in SQL selectRobert J Greene13 Mar
    • Re: Delete first found record in SQL selectChristian Mack16 Mar