|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
||||
|
||||
|
getting a set number of records
is there any way that i can do a query and possibly a sub query off that which grabs a set number of records. an example would be get a record set that is ordered by date. then use a sub query or something to grab just the first 3 of those. i could do it server side (using asp to just out put the first three) but its probably more efficient to have the sql server do the work.
word to your mother |
|
#2
|
||||
|
||||
|
What DB are you using? In postgres you do this with the LIMIT statement. Such as
SELECT * FROM table LIMIT 3. Quote:
Once again, my mother thanks you for your kind word. -b
__________________
PostgreSQL, it's what's for dinner... |
|
#3
|
||||
|
||||
|
i'm using the wonderful microsoft sql server. and i tried the limit thing, no go on that.
another word to your mother |
|
#4
|
||||
|
||||
|
Did a quick search on google, here's what I came up with, try:
SELECT TOP 3 * FROM table -b |
|
#5
|
||||
|
||||
|
works like a frickin charm! thanks! word to your mother, no wait, paragraph to your mother!
|
![]() |
| Viewing: Dev Shed Forums > Databases > Database Management > getting a set number of records |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|