RE: Contents of WHERE a predicate?

> -----Original Message-----
> From: www-ql-request@w3.org [mailto:www-ql-request@w3.org]On Behalf Of
> Evan Lenz
> Sent: Tuesday, April 24, 2001 4:12 PM
> To: Howard Katz; www-ql@w3.org
> Subject: RE: Contents of WHERE a predicate?
>
>
> Howard Katz wrote:
> > Maybe I wasn't clear enough. I'm trying to understand how two
> LET queries
> > differ, when one uses an inline XPath predicate,
> >
> >      LET $book := //book[  title = 'Data on the Web'  ]
> >      RETURN
> >             $book
> >
> > and the other uses a WHERE:
> >
> >     LET $book := //book
> >     WHERE $book/title = 'Data on the Web'
> >     RETURN
> >            $book
> >
> > I'm trying to see if there's anything interesting or significant to be
> > learned when that's the only distinction between the two. If you
> > change one
> > of the LET statements to a FOR, then that's a different problem
> > and not the
> > one I'm looking at here.
>
> Okay, I think you're implying that some rule dictates that the above two
> queries mean the same thing. That's definitely not the case. In the first
> query, the comparison is evaluated once for every book element in the
> document. In the second query, the comparison is evaluated only once,
> period. Think of "WHERE" as "IF" without an "ELSE" and maybe that
> will make
> more sense.
>
> Evan

Yeah, it did sort of feel like they were two forms of the same predicate
"thing," and so I was surprised to see them behaving so differently. Thanks
for the feedback.

Howard

>

Received on Tuesday, 24 April 2001 22:18:24 UTC