Mysql Query needed

Reply

Join Date: Jul 2006
Posts: 197
Reputation: vssp has a little shameless behaviour in the past 
Solved Threads: 5
vssp vssp is offline Offline
Junior Poster

Mysql Query needed

 
0
  #1
Sep 17th, 2008
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
Thanks
VSSP
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 883
Reputation: pritaeas will become famous soon enough pritaeas will become famous soon enough 
Solved Threads: 143
Sponsor
pritaeas's Avatar
pritaeas pritaeas is offline Offline
Practically a Posting Shark

Re: Mysql Query needed

 
0
  #2
Sep 17th, 2008
Can you give an example of what you are trying to achieve ?
"If it is NOT source, it is NOT software."
-- NASA
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 197
Reputation: vssp has a little shameless behaviour in the past 
Solved Threads: 5
vssp vssp is offline Offline
Junior Poster

Re: Mysql Query needed

 
0
  #3
Sep 17th, 2008
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
Thanks
VSSP
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 1,076
Reputation: Shanti Chepuru is on a distinguished road 
Solved Threads: 98
Shanti Chepuru's Avatar
Shanti Chepuru Shanti Chepuru is offline Offline
Veteran Poster

Re: Mysql Query needed

 
0
  #4
Sep 17th, 2008
  1. SELECT * FROM table WHERE c_id LIKE '% 4%';
Be intelligent, But Don't try to cheat.. Be innocent But Don't get cheated..
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 195
Reputation: mwasif is an unknown quantity at this point 
Solved Threads: 27
mwasif mwasif is offline Offline
Junior Poster

Re: Mysql Query needed

 
0
  #5
Sep 17th, 2008
Use FIND_IN_SET() function.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 643 | Replies: 4
Thread Tools Search this Thread



Tag cloud for MySQL
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC