heero11yuy Posted August 16, 2006 Share Posted August 16, 2006 If anyone can help me on the following, I'd be very appreciated~! How to retrieve a certain amount of field from a table (MSSQL)Say, I want to retrieve exactly 10 fields from a table?say, a column Word in a table WordList; I needa retrieve 10 words from column Word... may I use LIMIT in MSSQL?Thanks & have a great dayby Roy Link to comment Share on other sites More sharing options...
murfitUK Posted August 16, 2006 Share Posted August 16, 2006 You can use LIMIT to select a certain number of records from the database. The query will be something likeSELECT field_name1, field_name2 etc FROM table_name LIMIT 10;This selects the first 10 records. You can also use LIMIT x,y; This selects records starting at number x and the y says how many records you want. Eg LIMIT 12,4 will select records 12, 13, 14, 15 Link to comment Share on other sites More sharing options...
aspnetguy Posted August 16, 2006 Share Posted August 16, 2006 you cannot use limit with MSSQL, only MySQL. you need to do this instead SELECT TOP 10 * FROM tablename Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now