Thursday 9 February 2012

A random example of setting a table field to value of several CONCATenated fields from a separate table.


update comments set created_by = (select CONCAT(users.surname, ', ', users.forename, ' - ', users.email) from users where users.id=comments.user_id) where exists (select users.email from users where users.id=comments.user_id);

No comments:

Post a Comment

Note: only a member of this blog may post a comment.