List:General Discussion« Previous MessageNext Message »
From:Martin Ramsch Date:September 28 1999 5:17pm
Subject:Re: newbie question on deleting data
View as plain text  
On Tue, 1999-09-28 23:32:46 +0800, Thomas wrote:
> I'm new to MySql and have a syntax question.  If I want to remove
> multiple entries, how can I do this in one command?
> 
> ie.
> 
> delete from tablename where (id=102);     #this works fine for one id
> but is tedious after a while
> delete from tablename where (id=102 103 104 105...); # how about
> something to delete multiple entries.. am I close?

Quite close!
  DELETE FROM tablename WHERE id IN (102, 103, 104, 105, ...);

Regards,
  Martin
-- 
Martin Ramsch <m.ramsch@stripped> <URL: http://home.pages.de/~ramsch/ >
PGP KeyID=0xE8EF4F75 FiPr=52 44 5E F3 B0 B1 38 26  E4 EC 80 58 7B 31 3A D7
Thread
newbie question on deleting datathomas28 Sep
  • Re: newbie question on deleting dataMartin Ramsch28 Sep
  • Re: newbie question on deleting dataJeff Urban28 Sep
  • Re: newbie question on deleting databpaduraru28 Sep
  • Re: newbie question on deleting dataTonu Samuel28 Sep
  • Re: newbie question on deleting dataBob Kline28 Sep
  • Re: newbie question on deleting dataColin McKinnon29 Sep