Re: insert select problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Reply in-line:

On Thu, 17 Apr 2003 09:23:59 +0200, Merlin wrote:

>Hi there,
>
>I am facing a problem with the insert select syntax with mysql.
>
>I do want to insert into a tmp table the values out of a querry and another
>value:
>
>  INSERT INTO changes
>   SELECT
>        (here comes the statement)
>    , type = 1
>
>I would simply like to add type to the results. Can this be that hard? The
>statement above is wrong.
>

You're right.  It can't be done the way you are trying. 

You make it appear that "type" is a constant value for a given table, so... 
 
1. When you create the temp table, you could make the desired value the default for the column.

2. You can follow the INSERT ... SELECT query with a seperate UPDATE query.

3. You can find a different way of coding the value of "type" into the output result set that isn't part of a query.

Doug


>Thank you for any hint on that.
>
>Merlin
>
>
>
>-- 
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux