Just experimented with the short-hand version. It seems to work only
when the "stuff" table has a single field, although the field name
doesn't matter. More than one field causes a query error, even if the
field name being compared is in the table.
I've actually never seen this notation, but it does make sense. It would
be nice if it matched on field name, that way the same syntax could be
used in both cases.


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Monday, January 28, 2008 9:20 AM
To: [email protected]
Subject: Re: [sqlite] Number of elements in IN clause

"Samuel R. Neff" <[EMAIL PROTECTED]> wrote:
> I don't think it is standard SQL.  At the very least, it doesn't work 
> in MSSQL.  Standard is
> 
>       SELECT * FROM maintable WHERE key IN (select x from stuff);
> 
> SQLite shortened version is much nicer.. wish it was standard.
> 

SQLite also accepts the more verbose version shown above, of course.
The two statements do *exactly* the same thing.

I cannot believe that I would have put in the short-hand notation
without having seen it somewhere else first.
Does PostgreSQL support the short-hand version?

--
D. Richard Hipp <[EMAIL PROTECTED]>


------------------------------------------------------------------------
-----
To unsubscribe, send email to [EMAIL PROTECTED]
------------------------------------------------------------------------
-----


-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to