一千萬個為什麽

搜索

我需要選擇特定字符的值

我有一個可以包含以下值的字段。

Hello.  This value is from my MySQL table.  ---End Message---  Timestamped 6:00pm

I want to grab everything before the ---End Message--- String. It will always be formatted that way. So basically I just want to grab Hello. This value is from my MySQL table.

謝謝!

最佳答案

select substring_index('Hello.  This value is from my MySQL table.  ---End Message','---End Message---',1)

轉載註明原文: 我需要選擇特定字符的值