又有难题了,唉解决办法

WBOY
Release: 2016-06-13 13:53:53
Original
885 people have browsed it

又有难题了,唉
我把图片名存在数据库中了
有多个产品共用一个图
如:

prd_id     prd_name   prd_pic
1               NOKIA   1       1.gif
2               NOKIA   2       1.gif
3               NOKIA   3       2.gif

取出的时候怎么把1.gif放在一起取出?

------解决方案--------------------
select prd_id,prd_name from 数据表 where prd_pic= '1.gif ' order by prd_id
------解决方案--------------------
select prd_id,prd_name from 数据表 group by prd_pic order by prd_id
------解决方案--------------------
group by prd_pic

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