Ilyas,
Tuesday, August 27, 2002, 4:55:45 PM, you wrote:

IK> Can I also use a select statement in a create statement. Something like this:

IK> create table mytable
IK> (
IK>         id int not null primary key (select max(id) from mytable2),
IK>         name varchar(255)
IK> );

Nope.

IK> is this possible or is there an other way to do something like this?

What about INSERT .. SELECT ?

INSERT INTO mytable SELECT MAX(id),'Some name' AS name FROM mytable2
GROUP BY name;





-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Egor Egorov
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
       <___/   www.mysql.com



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to