鍍金池/ 問答/PHP  數據庫/ 求一條查詢語句

求一條查詢語句

table:
id date message userno
1 2017-11-16 16:02:40 hi zhangsan 13100000007
2 2017-11-16 16:00:11 hi lisi 13100000007
3 2017-11-17 16:00:11 hi wangwu 13100000008

我想查找出賬號13100000007的總記錄數,還有最新的一條記錄
怎樣查出如下結果:
count message date
2 hi zhangsan 2017-11-16 16:02:40

回答
編輯回答
念舊

select (select count(*) from table where id='13100000007') as 'count',message,date from table order by date desc limit 1

2018年9月6日 17:22
編輯回答
夕顏

select (select count()from table where id='378754' )message,date from table order by date desc limit 1

2017年7月18日 13:55
編輯回答
茍活
SELECT COUNT(*) as count, message, date FROM table WHERE id=13100000007 ORDER BY date DESC LIMIT 1
2018年5月29日 11:27