Re: HELP PLEASE - C API code help: UPDATE query using result from SELECT

2001-10-01 Thread John Mravunac
Aha, much appreciated...your words "therefore the target table may not appear in the SELECT clause" have made it clear to me...but can I assume that if I was to use aliases, then I would be able to sneak past this problem? :) John :^) Benjamin Pflugmann wrote: > Hi. > > As is described so

Re: HELP PLEASE - C API code help: UPDATE query using result from SELECT

2001-10-01 Thread Benjamin Pflugmann
Hi. On Tue, Oct 02, 2001 at 03:53:12PM +1000, [EMAIL PROTECTED] wrote: > Aha, much appreciated...your words "therefore the target table may not > appear in the SELECT clause" have made it clear to me...but can I assume > that if I was to use aliases, then I would be able to sneak past this > prob

Re: HELP PLEASE - C API code help: UPDATE query using result from SELECT

2001-10-01 Thread Benjamin Pflugmann
Hi. As is described somewhere (http://www.mysql.com/doc/R/E/REPLACE.html), REPLACE mainly behaves like INSERT and therefore the target table may not appear in the SELECT clause (as described here: http://www.mysql.com/doc/I/N/INSERT_SELECT.html). Sorry, but it seems you have to use a temporary t

RE: HELP PLEASE - C API code help: UPDATE query using result from SELECT

2001-10-01 Thread John Mravunac
Hi, When I try and use the REPLACE function such as: REPLACE INTO table1 SELECT table2.ID, table2.Modified FROM table1 INNER JOIN table2 ON table1.Company=table2.Company; I get: ERROR 1066: Not unique table/alias: 'table1' Here is the description of both tables: mysql> describe table1; +---

RE: HELP PLEASE - C API code help: UPDATE query using result from SELECT

2001-09-19 Thread Will French
I am struggling with this myself right now. I posted a similar question to this group earlier in the day and it must be a poser because no one has responded. I fear that the only way to do this with a single sql statement is using the replace command: Let's say you have 2 tables like this: Main