看板 PHP 關於我們 聯絡資訊
MySQL: select * from ttt where 1=1 order by id desc limit 0,1; 上面感覺好像一行文, 補些描述: order by id desc //依id由大而小排序, 假設愈新的記錄其id愈大. limit 0,1 //對於查詢結果從排列序號為0的那筆開始取, 只取1筆. ※ 引述《tnsshnews (tnsshnews)》之銘言: : select * from table where constraint; : 找出來的資料有好幾筆 : 但是我只想要列出最後新增的那一筆 : 請問要怎麼弄呢 : 謝謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 211.74.193.210