怎麼篩選的資料庫
發布時間: 2023-02-12 23:51:32
用group by語句可以篩選重復數據。
1、創建測試表、插入數據
createtabletest
(idint,
namevarchar(10));
insertintotestvalues(1,'張三')
insertintotestvalues(2,'李四')
insertintotestvalues(3,'王五')
insertintotestvalues(4,'趙六')
insertintotestvalues(1,'張三')
insertintotestvalues(2,'李四')
2、現在要篩選出重復數據,使查詢的數據不重復,可用語句
select id,name from test group by id,name;
3、結果如圖:
熱點內容