Jump to content

SQL, retrieving a certain amount of field from a table (MSSQL)


heero11yuy

Recommended Posts

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...