ID Hot
1 1
2 9,10,11
3 30
4 19,20,30
5 1,30
6 11
8 10,20,30
9 1,9,20
How do I find out if hot contains 1 of the data?
Final effect:
ID Hot
1 1
5 1,30
9 1,9,20
Reply to discussion (solution)
SELECT * from Tbl_name where Find_in_set (' 1 ', hot)
Thank you very much!
SELECT * from Tbl_name where Find_in_set (' 1 ', hot)
Need to write your own Find_in_set function!
Returns 0 rows after execution
Aren't you mysql?
SELECT * from Tbl_name where Find_in_set (' 1 ', hot)
Need to write your own Find_in_set function!
Returns 0 rows after execution
Find_in_set don't need yourself, I??? Yes, it's OK.
Line returns 0, you can see if there are??。 in the table
SELECT * from Tbl_name where Find_in_set (' 1 ', hot)
Need to write your own Find_in_set function!
Returns 0 rows after execution
Find_in_set don't need yourself, I??? Yes, it's OK.
Line returns 0, you can see if there are??。 in the table
What type of my data is in the wrong hot field! can use comma interval
SELECT * from Tbl_name where Find_in_set (' 1 ', hot)
Need to write your own Find_in_set function!
Returns 0 rows after execution
Find_in_set don't need yourself, I??? Yes, it's OK.
Line returns 0, you can see if there are??。 in the table
What type of my data is in the wrong hot field! can use comma interval
I'm using a varchar.
CREATE TABLE ' hot ' (' id ' int (ten) unsigned NOT NULL auto_increment, ' hot ' varchar ($) NOT NULL, PRIMARY KEY (' id ')) E Ngine=myisam auto_increment=1 DEFAULT charset=latin1