Rihards
Rihards

Reputation: 10349

How to select only some characters from MySQL field?

Is it possible and if so how to get only lets say 250 characters from a field with type "text" in my MySQL query? Or should I better create a new field with type varchar(250) which would contain the brief text for article?

Upvotes: 0

Views: 1614

Answers (1)

Chandu
Chandu

Reputation: 82903

You can use SUBSTRING Function in MySQL: For e.g. SELECT SUBSTRING('CYBERNATE', 2, 3) would return YBE

Upvotes: 2

Related Questions