Blogger Information
Blog 4
fans 0
comment 0
visits 5482
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
利用SQL语句返回不重复值
Ether
Original
829 people have browsed it

关键语句:distinct


方法一,可以直接搜索单列:


SELECT DISTINCT col from table;


方法二,搜索多个列:


SELECT * FROM table WHERE id in (SELECT MIN(id) FROM table GROUP BY col);

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post