Hi,
If the lenght of what wish to retrieve is fixed to 2 length,you can try
something like this:
select MID(YOUR_FIELD,3,IF(RIGHT(LPAD(YOUR_FIELD,4,','),1)=',',1,2)) from
YOUR_TABLE;
Regards,

Gelu
_____________________________________________________
G.NET SOFTWARE COMPANY

Permanent e-mail address : [EMAIL PROTECTED]
                                          [EMAIL PROTECTED]
----- Original Message -----
From: "Paul van Brouwershaven" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, November 16, 2002 3:45 PM
Subject: SQL Query


> Hi,
>
> I have a colum with this values :
>
> ,1,4,5,66,247,7,
> ,1,3,5,62,767,6,
> ,1,5,5,11
> ,1,9,5,36,7677,9,
> ,1,40,55,66,444,3,
>
> I want to get whis values : (second field)
>
> 4
> 3
> 5
> 9
> 40
>
> I have tried this :
>
>  REPLACE(SUBSTRING_INDEX(value, ',', 3), ',','')
>
> But the following is returned :
>
> 14
> 13
> 15
> 19
> 140
>
> I have alse tried the following query :
>
> select
> mid(path,locate(2,path,",")+1,(locate(locate(2,path,",")+1,path,",")-loc
> ate(2,path,",")-1)) from path_table
>
> Regards,
>
> Paul
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
>


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to