A: 

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
Hm, now I got following error message: #1305 - FUNCTION timetracker.charindex does not exist . But thanks for the hint, hope I can build it up.
Soloco
Forgot to mention, this query works on MS-SQL SERVER 2005. You might have to get corresponding function for charindex in mysql. Have edited the answer above, check if that helps.
Sachin Shanbhag
Well that solved my charindex problem. But the output is empty now. It only shows one empty cell below title. Any idea of what the problem is or how to solve it?
Soloco
pls rate the answer if it was helpful.. On empty rows, not sure buddy. I am new to mysql. So probably u can check how Locate works.
Sachin Shanbhag
Well, I actually can't rate, but I will accept the answer asap I solved my empty row problem. Thanks for your help anyway.
Soloco
A: 

Well, it's not a beautiful solution, but it fulfills my needs right now.

SELECT SUBSTRING(title,2,5)

If you see any other possibility please post. Thank you in advance.

Soloco