update [table] select - but I only need part of the column field value to select

update [table] select - but I only need part of the column field value to select

am 26.01.2006 20:38:06 von phillip.s.powell

[code]
UPDATE redesign.student SET student_work_area_other SELECT
REPLACE('anywhere,(.*)', '$1', i.work_area) AS regexp_col FROM
mycompany.interns i, redesign.student s WHERE i.unique_key =
s.unique_key GROUP BY work_area
[/code]

Of course this does not work, but I have no idea what the MySQL
equivalent will be to something like this.

I basically want to take out PART of a column field value and update it
into another database table. How is that done?

Thanx
Phil

Re: update [table] select - but I only need part of the column field value to select

am 26.01.2006 21:37:11 von Markus Popp

Hi,

you can include subqueries that have this form:

UPDATE table_name SET field_name = (SELECT one_field FROM another_table)
WHERE any_condition

Markus