Click here to Skip to main content
15,886,873 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i want to get the highest integer value of the id from the table mails.

i m using this command for it, but it is not working...

" select id from mails where id>= (select id from mails) "

pls suggest something.....
Posted

SQL
SELECT MAX(id) FROM mails where ...

see SQL MAX()[^] or MAX T-SQL[^]
 
Share this answer
 
v2
Comments
RaisKazi 28-Aug-11 5:47am    
Simple and short. 5!
Simon Bang Terkildsen 28-Aug-11 5:48am    
Thank you, RaisKazi
Try:
SQL
SELECT MAX(id) FROM mails
 
Share this answer
 
Comments
RaisKazi 28-Aug-11 5:47am    
Simple and short. 5!
Simply try...... SELECT MAX(id) FROM mails
For more details see this... http://www.w3schools.com/sql/sql_func_max.asp[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900