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.
searching a substring within a set of string in mysql
Moderator: General Moderators
- Ollie Saunders
- DevNet Master
- Posts: 3179
- Joined: Tue May 24, 2005 6:01 pm
- Location: UK
Re: searching a substring within a set of string in mysql
Try the ORDER BY clause