Hi I have a column called mix which is as follows
120
102 201
300
234 212
11 21
So the issue is I want to extract the digits of the left when a space is found, I am trying that with substring as shown below, I wonder why it is not working.
select mix,
SUBSTRING(mix,1,CHARINDEX(' ',mix)-1)
FROM tbl_xx
where CHARINDEX(mix,' ')>0