Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

获取自增序列SQL实现 #164

Closed
hanahmily opened this issue Oct 27, 2016 · 2 comments
Closed

获取自增序列SQL实现 #164

hanahmily opened this issue Oct 27, 2016 · 2 comments

Comments

@hanahmily
Copy link
Contributor

hanahmily commented Oct 27, 2016

使用

SELECT LAST_INSERT_ID();

获取自增序列

@terrymanu
Copy link
Member

已可以使用getGeneratedKeys的标准做法代替LAST_INSERT_ID(),不建议使用LAST_INSERT_ID()这样的非标准化SQL

@lanmo
Copy link

lanmo commented Jul 27, 2017

如果使用mybatis 标签使用
useGeneratedKeys="true" keyProperty="id"
并不能获取到自增的主键id值

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants