mysql bagaimana query mengambil tiga kata pertama dari string

Bagaimana ya, cara mengambil tiga kata pertama dari sebuah field yang bertime string ?

Bismillah

q> tadi ada yang tanya di forum mysql Indonesia (fb),

q> O iya ya gmn caranya,, saya juga belum pernah query kaya gtu, googling bentar

q> joss joss joss dapet😀

q> Ayo kita tes, begini description dan datanya :

Selection_550

q> Dan ini querynya :

SELECT SUBSTRING_INDEX(kata, ' ', 3) AS tiga_kata FROM kata;

Selection_549

q> Berhasil

Alhamdulillah.

sumber :
http://biostall.com/getting-the-first-word-of-a-string-with-mysql

Published by

saifiahmada

Begin a big Process with a bit trying

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s