Hi,

Try setting the default value of the column to 'Yes' that should work or

INSERT INTO Allocations(Project_ID, User_ID, field) SELECT  P.Project_ID,
U.User_ID, 'Yes'  FROM Users U, Projects P, Clients C WHERE P.Client_ID =
C.Client_ID AND U.Client_ID = C.Client_ID AND Project_ID =".$project_id)


Met vriendelijke groet,

Almar van Pel

-----Oorspronkelijk bericht-----
Van: Shaun [mailto:[EMAIL PROTECTED] 
Verzonden: woensdag 23 november 2005 15:22
Aan: mysql@lists.mysql.com
Onderwerp: INSERT SELECT Problem

Hi,

The following query worked fine:

INSERT INTO Allocations(Project_ID, User_ID) SELECT  P.Project_ID, U.User_ID
FROM Users U, Projects P, Clients C WHERE P.Client_ID = C.Client_ID AND
U.Client_ID = C.Client_ID AND Project_ID =".$project_id)

However I want to add a column to the INSERT part of the query and the value
to be inserted must always be 'Yes'. Is there a way to do this with just
with one query?

Thanks for your help. 



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




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

Reply via email to