SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict
    Join Date
    Feb 2003
    Location
    Berlin
    Posts
    370
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Merge fields in SQL

    Hi,

    I have a Dataset with following content:

    locid,ip,date,location,street,nr,zip,city,fon,fax,url,email,notes

    in my new database i want to merge street and nr into one field (street).

    How could I merge to fields with load data infile:
    load data infile '/users/archinoah/kalender.txt' into table events_location FIELDS TERMINATED BY ',' ENCLOSED BY '\'' lines terminated by '\n' ( locid,ip,date,location,street,zip,city,fon,fax,url,email,notes);
    ???

    Thanks
    Fl÷zen

  2. #2
    SitePoint Addict
    Join Date
    Feb 2003
    Location
    Berlin
    Posts
    370
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If someone is interested:
    Imort to database with all fields, then merge:
    Update events_location set street=concat(street,' ',nr);
    and finally delete the nr field.


Bookmarks

Posting Permissions

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