View Single Post
  #9 (permalink)  
Old Feb 25th, 2008, 10:17
meth8200 meth8200 is offline
Junior Member
Join Date: Feb 2008
Location: UK
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Query postcode issue?

Hi People,

I know this is a mysql forum but would you know how this would work in sql enterprise

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

it doesnt like the if statement.......

works fine in mysql!

Cheers!!!
Reply With Quote