歡迎您光臨本站 註冊首頁
小知識  >  Mysql >

在mysql中如何獲得

admin @ 2017-12-03 reply:0
←手機掃碼閱讀

樓主可以參考下列例句: 列出所有年齡最大的學生資料 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中如何獲得已經有844次圍觀

http://coctec.com/room/show-1528.html