php – MySQL:从总值中只显示200个字符

前端之家收集整理的这篇文章主要介绍了php – MySQL:从总值中只显示200个字符前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

我有一个MySQL表,其中包含一个名为description的字段,其中包含如下记录:

Former cop Brian O’Conner partners with ex-con Dom Toretto on the opposite side of the law.Since Brian and Mia Toretto broke Dom out of custody,they’ve blown across many borders to elude authorities. Now backed into a corner in Rio de Janeiro,they must pull one last job in order to gain their freedom. As they assemble their elite team of top racers,the unlikely allies know their only shot of getting out for good means confronting the corrupt businessman who wants them dead. But he’s not the only one on their tail. Hard-nosed federal agent Luke Hobbs never misses his target. When he is assigned to track down Dom and Brian,he and his strike team launch an all-out assault to capture them. But as his men tear through Brazil,Hobbs learns he can’t separate the good guys from the bad.

如何显示前200个字符?像这样:

Former cop Brian O’Conner partners with ex-con Dom Toretto on the opposite side of the law.Since Brian and Mia Toretto broke Dom out of custody,they’ve blown across many borders to elude authorities.

最佳答案
SELECT LEFT(description,200)
FROM yourtable

相关文档here.

原文链接:https://www.f2er.com/mysql/434220.html

猜你在找的MySQL相关文章