关键语句: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!