954,593 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Mysql Query needed

hi friends

I need the query , I have stored the ids like this 4,10,12,13,14 in one filed.

I need to search the id 4 avaliable in the one filed , how to search the number one single filed?


Please advise

vssp
Junior Poster
199 posts since Jul 2006
Reputation Points: 5
Solved Threads: 5
 

Can you give an example of what you are trying to achieve ?

pritaeas
Posting Expert
Moderator
5,484 posts since Jul 2006
Reputation Points: 653
Solved Threads: 875
 

in my table i have stored id like this
id name c_id
insert into (id,name,c_id)values( 1, john, 4,10,12,13,15)
Now i need seach id 10 avilable this row.how to write query,

Hope you clear

vssp
Junior Poster
199 posts since Jul 2006
Reputation Points: 5
Solved Threads: 5
 
select * from table where c_id like  '% 4%';
Shanti C
Posting Virtuoso
1,642 posts since Jul 2008
Reputation Points: 137
Solved Threads: 162
 

Use FIND_IN_SET() function.

mwasif
Posting Whiz
315 posts since Dec 2007
Reputation Points: 29
Solved Threads: 48
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You