[ic] Re: how to remove records from database

Russ Riggs interchange-users@lists.akopia.com
Mon Jul 2 09:48:00 2001


That is the correct syntax.  You can use either LIKE or MATCHES
and you can use either the '%' or the '*'....assuming, of course, that
mysql is ansi compliant.  So you should be able to mass delete with
either

delete from merchandising where sku matches 'os*';

or

delete from merchandising where sku like 'os%';

as shown below.

Now to a question I have.  I prefer to handle the maintenance of the
database thru the admin UI as opposed to mucking directly with the
database.  I deleted all the items from the database via the 'items'
editor an assumed, erroneously, that all records that are related to
those items (processing too) would be handled...ie., any order,
specials, promos, etc., would be automatically dealt with.  Can someone
tell me a quick and dirty way to zero out the database so that I may
add my own merchandise so I can see what this thing looks like?

Thanks....

Mark Johnson wrote:

> Raymond wrote:
> >
> > this command works
> >
> > delete from merchandising where sku = "os28004";
> >
> > and so on, you have to list them one by one,
> > "os*"; doesn't pickup all the names that start with os,
> > why not ?
> >
>
> It is not an '='. However, since you didn't post the query that didn't
> work, I can only assume that's the problem.
>
> delete from merchandising where sku LIKE "os%";
>
> --
> Mark Johnson
> Senior Systems Architect - Professional Services
> Red Hat, Inc.
> E-Business Solutions
> markj@redhat.com
> 703-456-2912
> _______________________________________________
> Interchange-users mailing list
> Interchange-users@lists.akopia.com
> http://lists.akopia.com/mailman/listinfo/interchange-users