rp
asked on
Sql Server 2008 Express R2 select max id
I am using select max id in a query (SELECT MAX(id) FROM table), but it gives me the impression that sometimes the value returned is not the last id. What better way to get the last record.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If it is the key column of the table, it is better to configure it as an automaticaly incremental generated number.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi
Maybe type of Id is problem.
For example if type of Id is int or nvarchar sort order is different.
Maybe type of Id is problem.
For example if type of Id is int or nvarchar sort order is different.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.