|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
ASP/MS SQL - Select only the first 3 records using SQL
Hi guys,
I have a basic news system on my site. Anyway I was to display on the 3 most recent threads on the home page. I'm not sure how to do a select is MS SQL do to this? At the moment I use: "Select * from news order by articledate" Which pulls all the news articles. I want to limit it to pull only the 3 latest news articles? Anyone know how to achieve this? Thanks in advance James |
|
#2
|
|||
|
|||
|
Top 3 *
Did u try using "TOP 3)
try out this "Select TOP 3 * from news order by articledate" Quote:
|
|
#3
|
|||
|
|||
|
"Select TOP 3 * from news order by articledate"
|
|
#4
|
|||
|
|||
|
Quote:
Thanks that was it! ![]() |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft SQL Server > ASP/MS SQL - Select only the first 3 records using SQL |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|