1.查詢pnum欄位中包含3或者9的記錄
select * from test where find_in_set('3',pnum) or find_in_set('9',pnum);
select * from test where concat(',',pnum,',') regexp '[^0-9]+[3|9][^0-9]+';
2. cover欄位為:(admin/lupiemd1pk6u6b,admin/lupiemd1pk6u6b,admin/lupiemd1pk6u6b)
取逗號分隔第乙個詞:
select left(cover, locate(',',cover)-1) from product_album
3. mysql 查詢某字段的多條結果顯示成按逗號隔開
有表:tel
字段:id tel
1 13578945620
2 13578945621
3 13578945622
4 13578945623
5 13578945624
查詢tel欄位,出現的結果是這樣的:13578945620,13578945621,13578945622,13578945623,13578945624
select group_concat(tel) from tt
4. 欄位faccounts是逗號隔開的
MySQL 模糊查詢某字段用逗號隔開
1.查詢pnum欄位中包含3或者9的記錄 select from test where find in set 3 pnum or find in set 9 pnum select from test where concat pnum,regexp 0 9 3 9 0 9 2.cover欄位為 ...
MYSQL查詢某欄位中以逗號分隔的字串的方法
首先我們建立一張帶有逗號分隔的字串。create table test id int 6 not null auto increment,primary key id pname varchar 20 not null,pnum varchar 50 not null 然後插入帶有逗號分隔的測試資料...
MYSQL查詢某欄位中以逗號分隔的字串的方法
首先我們建立一張帶有逗號分隔的字串。create table test id int 6 not null auto increment,primary key id pname varchar 20 not null,pnum varchar 50 not null 然後插入帶有逗號分隔的測試資料...