enter code hereTry this -
select substring(<columnname>,0,charindex(' ', <columnname>)) from <tableName>
In your case, the query will be -
select substring(title,0,charindex(' ', title)) from myTable
This works only if you have spaces and other text follwing your #<number>
USE LOCATE instead of Charindex for mysql -
http://www.overclock.net/web-coding/450373-mysql-query-help.html
Sachin Shanbhag
2010-08-05 08:47:33