Page 1 of 1

searching a substring within a set of string in mysql

Posted: Fri Jun 27, 2008 12:36 am
by basudeb
Suppose i have a table customer with fields (id(primary key, auto incremented),name ,......., employee_id). and the data type of the field employee_id is text . Suppose the records are like :

1,'basudeb', . ..,.., '6,7,8,10,11' ;
2,'sumon', ..., '10,12,14,15,16' ;
3,'mithun',...,...,' 7,8,11,10' ;
4,'arun',....,..,'10' ;
5,'barun',.., ..,'10,11';
6,'Jon', ...., ...,'11,10,8,7,6';

Now i want to get the records where 10 is presents as employee_id.
I have used the in operator but it returns the records where 10 is presents at first. please give suggestion.

Re: searching a substring within a set of string in mysql

Posted: Fri Jun 27, 2008 3:35 am
by Ollie Saunders
Try the ORDER BY clause