Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Truncating MySQL fields

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
How do you truncate the contents of a database field so that only the first 60 characters are displayed rather than the whole thing....I have a text field and a blob field and when that contains a lot of data it throws off the display of my entire table when I want to look at it, etc.

Any help would be appreciated...

Thanks.
 
select distinct left([field_name], 60) from [table_name];

OR

select substring([field_name], 1, 60) as b from [table_name]
group by b;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top