View Single Post
  #4 (permalink)  
Old Feb 21st, 2008, 12:22
puzz puzz is offline
Junior Member
Join Date: Feb 2008
Location: Poreč
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Query postcode issue?

You can try something like this:

select substring(postcode,1,if(instr(postcode," ")=0,length(postcode),instr(postcode," "))) from my_table;

It will return part of your string from the first character to the first space...
Reply With Quote