On Sun, Sep 24, 2000 at 11:07:03PM +1100, Dean Hamstead wrote:
> Is there a command to add to the end of a field when updating
> rather than overwriting it. Rather than extracting the current
> data, joining then updating the field?

update tablename set field1=field1+"new text" where recordid=55

You can make it a bit more conditional if needed. eg, if there's already
something in the field add a comma then the new value, otherwise just put
in the new value (with no comma)

update tablename set field1=field1+",new text" where recordid=55 and
     field1 is not null
update tablename set field1="new text" where recordid=55 and
     field1 is null

  Scott.


--
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://slug.org.au/lists/listinfo/slug

Reply via email to