MySQL數據庫查詢之聚合查詢

關鍵字 distinct   去重,在結果中去除重複的行。 語法: select distinct column_names from 表名; 我打開的是一個訂單詳情表 作用於單列:  select distinct(order_id) from order_detail where id<30;   我們看一下效果 作用於多列: select distinct order_id, buy_num
相關文章
相關標籤/搜索