我試圖將查詢的持續時間詳細信息記錄到表中。我遇到的問題是第8行。 這是因爲我需要從行2 & 3返回創建QUERY_ID的方法?從插入語句返回Query_ID
1)Set profiling =1;
2)INSERT INTO Master
3)VALUES ("[email protected]","efheif","pwoe");
4)INSERT INTO Duration(Status,DURATION)
5)SELECT STATE, FORMAT(DURATION, 6) AS DURATION
6)FROM INFORMATION_SCHEMA.PROFILING;
7)SELECT * FROM INFORMATION_SCHEMA.PROFILING
8)WHERE QUERY_ID = 1;
感謝
http://stackoverflow.com/questions/3837990/last-insert-id-mysql – ryan1234 2013-02-19 18:40:11