Marilyn Drewry wrote:
> Perhaps this belongs to the SQL thread but I want
> to do something similiar to what I have done in
> Oracle.
>
> I have a row that I want to duplicate by selecting
> it and then inserting into the same table.
> In Oracle I can then select info along with rowid,
> then using the rowid update only the new record.
>
> Does mysql support anything like that?
>
> Example:
>
> insert into tablex select * From tablex where
> somfield = 'a';
> select rowid, somfield from tablex where
> somfield = 'a"; < returns 2 rows
> update tablex set somfield = 'b' where rowid =
> 'XXXXXX'; < updates only the new record
>
We do not have a rowid. For your purpose, the best thing would be to
define a surrogate primary key with an auto_increment field, and use
that to reference your row for subsequent updates.
Regards,
Josh
Josh Chamas
Director, Professional Services
MySQL Inc., www.mysql.com
Get More with MySQL!
http://www.mysql.com/consulting