June 22, 2006 at 11:46 pm
How i can get max value from Table like CustId withour using Max() Function
June 23, 2006 at 1:12 am
Hi Tushar..
You could write a loop and scan all of your records to find the MAX() value, but that will certainly be more expensive than using the MAX() function.
Is this an intellectual exercise or is there a reason you're reluctant to use MAX()?
- Ward Pond
blogs.technet.com/wardpond
June 27, 2006 at 11:46 am
Select Top 1 CustID
from <TableName>
Group by CustID
Sort by Desc
or
Select Max(CustId)
from <TableName>
June 27, 2006 at 1:57 pm
The first alternative would probably be more efficient as an ORDER BY CustID DESC but it's a good call..
- Ward Pond
blogs.technet.com/wardpond
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply