Re: Is mysql a RDBMS ?

From: Mikito Harakiri <mikharakiri_at_ywho.com>
Date: Mon, 25 Aug 2003 10:53:20 -0700
Message-ID: <xas2b.10$V06.160_at_news.oracle.com>


"Bob Badour" <bbadour_at_golden.net> wrote in message news:Nws2b.656$cK7.79368235_at_mantis.golden.net...
> > > > Chris Date claims that the concept of a multiset is confusing
> > >
> > > It is worse than confusing. Consider the following table:
> > >
> > > A
> > > =
> > > 1
> > > 1
> > > 1
> > > 2
> > >
> > > When you observe the table variable above and decide you need to
delete
> > > exactly one row where A = 1, how do you express the deletion in SQL?
> >
> > In MySQL you write
> >
> > DELETE FROM ... WHERE A = 1 LIMIT 1;
>
> I see the latest ANSI standard had kludged a solution to that specific
> question. My first thought is: Which of the three rows does it delete?
Why?
> But I have a much more interesting question: Suppose one cannot predict
> exactly how many rows are 1, but one knows one must to delete all but 2 of
> them. How does one express the deletion in SQL?

Scalar subquery can calculate the number of 1s. All that is need from the implementation, then, is scalar subqueries allowed in the "limit" clause. Received on Mon Aug 25 2003 - 19:53:20 CEST

Original text of this message