Home > Backend Development > PHP Tutorial > sql查询除了字段中相同的值

sql查询除了字段中相同的值

WBOY
Release: 2016-06-13 12:29:35
Original
977 people have browsed it

sql查询去除字段中相同的值
userid     group_concat(title)   group_concat(oid)         group_concat(statue)
1          保过,保过,教程      sp111,sp234,sp134       1  0  1
根据这个statue属性去除title值相同的内容为1 就保留 为0 就去除。
userid     group_concat(title)   group_concat(oid)         group_concat(statue)
1          保过,            教程      sp111,sp234,sp134       1    1                         select userid,group_concat( title),group_concat(distinct oid) from `djs_shops_products` 
where status=1 
group by userid; 

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template