樓主可以參考下列例句: 列出所有年齡最大的學生資料 select * from students where date_of_birth= (select max date_of_birth from students); 或者 select a.* from students a where not exists ( select 1 from students b where b.date _of_birth >a.date_of_birth); 第二種寫法在有索引可被利用時效率很高,可作為首選,但是無索引可被利用且是大數據表的情況下效率很低,此時應避免使用。
[admin via ] 在mysql中如何獲得已經有846次圍觀