Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Oct 2009
    Posts
    432
    Thanks
    6
    Thanked 3 Times in 3 Posts

    copy field content to another field in same table

    How do I copy content from one field to another when both field are in the same table?

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,158
    Thanks
    75
    Thanked 4,338 Times in 4,304 Posts
    Code:
    UPDATE tablename SET tofield = fromfield
    If you only want that to happen for *some* values, then just add a WHERE clause:
    Code:
    UPDATE tablename SET tofield = fromfield WHERE somecondition
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •