How to query array id hot
1 1
2 9, 10, 11
3 30
4 19,20, 30
5, 30
6 11
8 10, 20, 30
9, 9, 20
How can I find the data with hot containing 1?
Final effect:
Id hot
1 1
5, 30
9, 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)
Do you need to compile the find_in_set function yourself!
0 rows are returned after execution.
Are you not mysql?
select * from tbl_name where find_in_set('1', hot)
Do you need to compile the find_in_set function yourself!
0 rows are returned after execution.
Does find_in_set need to be self-contained ?, Me ??? Rows are acceptable.
? The row returns 0. can you check whether the table exists ??.
select * from tbl_name where find_in_set('1', hot)
Do you need to compile the find_in_set function yourself!
0 rows are returned after execution.
Does find_in_set need to be self-contained ?, Me ??? Rows are acceptable.
? The row returns 0. can you check whether the table exists ??.
What is the type of the hot field when my data is stored incorrectly! Separated by commas
select * from tbl_name where find_in_set('1', hot)
Do you need to compile the find_in_set function yourself!
0 rows are returned after execution.
Does find_in_set need to be self-contained ?, Me ??? Rows are acceptable.
? The row returns 0. can you check whether the table exists ??.
What is the type of the hot field when my data is stored incorrectly! Separated by commas
I use varchar.
CREATE TABLE `hot` ( `id` int(10) unsigned NOT NULL auto_increment, `hot` varchar(200) NOT NULL, PRIMARY KEY (`id`)) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=latin1