Jump to content
Xtreme .Net Talk

Recommended Posts

Posted (edited)

I have a table with Id field.it is identity and has many values, not i need the greatest value of identity...

Notice:The answer must be one record not two or more ;)

How can i select the biggest value of Id field?

For example:

SELECT MAX(Id) ,manyfields
from tablename
Group by manyfields

//****************************************************

[This shows the all of rows & fiels! :eek:

http://doost.europe.webmatrixhosting.net/sql/max01.gif

I want to see only 7 :)

Edited by shahab
Posted
try this:

 

select max(newsid) as mID from tblNews

thanks I knew that but iawnt to see the biggest record id and the oder fiels too!!

this query shows only 7 but i want to see all of fields that their id is 7!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...