Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how i get only one row from sql select statement

Status
Not open for further replies.

fuadhamidov

Programmer
Sep 22, 2003
98
TR
hi
i want to get only one row by using sql select statement or an other way. when i use sql select i may return hundreds of rows, so it decrease the speed of program. is there any way to get only one line. my code like:
select date from <whatever> order by date
 
In a nutshell, your SQL says...

'Show all of the dates in the whatever table and order them.'


If you want the most recent date, you should have something like this....

select max(date) from <whatever>

 
hi
thanks more
i have found
select top 1 date from <whatever> order by date
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top