Shaun,

You need two columns for the insert, but you're only selecting one.

Try this:

INSERT INTO Letter_Templates (Work_Type_ID, Project_ID) SELECT
Work_Types.Work_Type_ID, Work_Types.Project_ID FROM Work_Types WHERE
Work_Types.Project_ID = 'x';

Andy


> -----Original Message-----
> From: shaun thornburgh [mailto:[EMAIL PROTECTED]
> Sent: 07 July 2004 13:37
> To: [EMAIL PROTECTED]
> Subject: INSERT SELECT
> 
> Hi,
> 
> Using the following query I am attampting to insert the Work_Type_IDs from
> Work_Types WHERE Project_ID = 'x'. However I also wan to insert the
> Project_ID into the table, how would this syntax work - apperently the
> column count is incorrect...
> 
> INSERT INTO Letter_Templates (Work_Type_ID, Project_ID) SELECT
> Work_Types.Work_Type_ID FROM Work_Types WHERE Work_Types.Project_ID = 'x';
> 
> Thanks for your help
> 
> _________________________________________________________________
> Want to block unwanted pop-ups? Download the free MSN Toolbar now!
> http://toolbar.msn.co.uk/
> 
> 
> --
> 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