[Err] 1293 - Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
2016-07-01
SuccessKilled queryByIdWithSeckill(long seckillId);有問題啊,秒殺成功表里面應該存在(1000,phone1),(1000,phone2)這樣的記錄。是不是應該使用id和phone聯合查詢出秒殺成功的記錄。不然就只有第一個人能秒殺成功,后面的都會異常。
2016-06-29
已采納回答 / 鍵盤兔
我查了資料 這里不應該用?timestamp?要用?datetimetimestamp 不能由用戶插入數據的時候指定值,它要么設置了默認值永遠不變,要么就只有數據創建和改變的時候由mysql更新為當前時間。下文來自:http://lavasoft.blog.51cto.com/62575/280284MYSql5的日期類型有三種:date(只有日期)、datetime(時分秒)和timestamp(時分秒)。一、TIMESTAMP1、TIMESTAMP列必須有默認值,默認值可以為'0000-00-00 0...
2016-06-25
mybatis里面mapper映射的sql,如果要加單行注釋的話,一定要在--后面跟一個空格啊,否則就解析失敗了。
s.create_time as "seckill.create_time" --comments here
報錯:
org.springframework.jdbc.BadSqlGrammarException:
### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL
s.create_time as "seckill.create_time" --comments here
報錯:
org.springframework.jdbc.BadSqlGrammarException:
### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL
2016-06-24
http://www.mybatis.org/mybatis-3/zh/getting-started.html
2016-06-24