1. 程式人生 > >SQL中遇到多條相同內容只取一條的最簡單實現

SQL中遇到多條相同內容只取一條的最簡單實現

  2、select * from timeand as a where not exists(select 1 from timeand where a.time = time and a.total<total);

  此中方案排除了方案1中name欄位不準確的問題,取的是total最大的值