Hi J smith,

Below  was my sample not James. For my sample ou will need the brackets or it 
will give you an error.

Hi James,

You are right it gives an error, but as J Smith also pointed out in your case 
you dont need the brackets, in my case you would need it. ;-)

Best regards

Nils Valentin
Tokyo/Japan




2003年 8月 14日 木曜日 17:47、Jim Smith さんは書きました:
> But why do you need the parentheses?
>
> What is wrong with
>
> CREATE TABLE Foo2
>       SELECT * FROM sensei
>       WHERE last_name IN (SELECT last_name
>                                 FROM sensei UNION ALL
>                                 select last_name
>                                 FROM sensei)
>       ORDER BY e_mail;
>
> > -----Original Message-----
> > From: James Fryer [mailto:[EMAIL PROTECTED]
> > Sent: 14 August 2003 09:41
> > To: [EMAIL PROTECTED]
> > Subject: Re: CREATE TABLE, INSERT INTO with SELECT in parentheses
> >
> > At 09:22 am 14/08/03, Nils Valentin wrote:
> > >I don' t understand your question. Why do you hink you that
> >
> > the brackets
> >
> > >would't work ?
> > >
> > >I tried that without any problems. Please post your code.
> > >
> > >Here is mine:
> > >
> > >SELECT * FROM sensei WHERE last_name IN (SELECT last_name
> >
> > FROM sensei UNION
> >
> > >ALL select last_name FROM sensei) ORDER BY e_mail;
> >
> > Here's some code that demonstrates what I mean:
> >
> > ------ Cut Here ------
> > CREATE DATABASE Foobar;
> > USE Foobar;
> > CREATE TABLE Bar (id int(10) unsigned);
> >
> > # Works
> > SELECT * FROM Bar;
> >
> > # Works
> > CREATE TABLE Foo1 SELECT * FROM Bar;
> >
> > # Works
> > (SELECT * FROM Bar);
> >
> > # Fails (syntax error)
> > CREATE TABLE Foo2 (SELECT * FROM Bar);
> >
> > DROP DATABASE Foobar;
> > ------ Cut Here ------
> >
> > Using MacOS so please forgive any errors due to case-sensitivity.
> >
> > Jim
> > --
> > James Fryer  /  [EMAIL PROTECTED]  /  [EMAIL PROTECTED]
> >
> >
> > --
> > MySQL General Mailing List
> > For list archives: http://lists.mysql.com/mysql
> > To unsubscribe:
> > http://lists.mysql.com/[EMAIL PROTECTED]

-- 
---
Valentin Nils
Internet Technology

 E-Mail: [EMAIL PROTECTED]
 URL: http://www.knowd.co.jp
 Personal URL: http://www.knowd.co.jp/staff/nils


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to