Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^5: Truncate Data from MySQL

by zebedee (Pilgrim)
on Jul 08, 2009 at 07:53 UTC ( #778151=note: print w/replies, xml ) Need Help??


in reply to Re^4: Truncate Data from MySQL
in thread Truncate Data from MySQL

And here is an example:

mysql> SELECT SUBSTRING_INDEX('A bunch of words that you only want the + first fifteen from goes here as this example shows nicely',' ',15) A +S first_15 FROM property LIMIT 1; +--------------------------------------------------------------------- +----+ | first_15 + | +--------------------------------------------------------------------- +----+ | A bunch of words that you only want the first fifteen from goes here + as | +--------------------------------------------------------------------- +----+ 1 row in set (0.00 sec) mysql> SELECT SUBSTRING_INDEX('But what if only a few words?',' ',15) +AS first_15 FROM property LIMIT 1; +-------------------------------+ | first_15 | +-------------------------------+ | But what if only a few words? | +-------------------------------+ 1 row in set (0.00 sec)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://778151]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2021-09-25 01:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?