如何重写表中的最后一个插入ID [英] How to reterive the last insert id from table

查看:73
本文介绍了如何重写表中的最后一个插入ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我的表中有一个ID coloumn作为uniqueidentifier数据类型。我想获取最后一个插入的id ..请告诉我该怎么办...

解决方案

嗨..

看到这个,可能对你有帮助。

 选择 * 来自 tablename 订单  by  columnname  desc  limit  1 ; 



谢谢你。


scope_identity()是带来它的函数。我在CP回答了这个问题!


您好



查看此链接..



http://technet.microsoft.com/en-us/ library / ms190315.aspx [ ^

Hello,
I have an ID coloumn as uniqueidentifier datatype in my table .And I want to fetch the last inserted id..please tell me how can i do this..

解决方案

Hi..
See this one, may its helpful to u.

select * from tablename order by columnname desc limit 1;


Thank u.


scope_identity() is the function that'll bring it. Got that answer myself here in CP!


Hi

have a look on this link..

http://technet.microsoft.com/en-us/library/ms190315.aspx[^]


这篇关于如何重写表中的最后一个插入ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆