SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Mar 2010
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Truncating output to a given character legnth

    All,
    I am trying to transform an existing dataset to meet the specifications of a different data structure so that it can be moved. Some field lengths are off, and as such I would like to automatically cut off the existing text at that length to allow for the transfer as changing each individual record is just not practical. Is there an easy way to do this with mysql?

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,215
    Mentioned
    58 Post(s)
    Tagged
    3 Thread(s)
    LEFT(foo,123) will truncate the foo column value to 123 bytes
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


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
  •