Learn SQL Server from the Best Tutors
Search in
To display specific records from a table in SQL, you can use the LIMIT
and OFFSET
clauses to control the number of rows returned and the starting point. Note that the OFFSET
clause is 0-based, so the first record is at position 0.
Assuming you have a table named EMP
and you want to display the 4th, 6th, and 7th records, you can use the following query:
SELECT * FROM EMP ORDER BY <your_ordering_column> -- replace with the column you want to order by LIMIT 3 OFFSET 3; -- 4th, 6th, and 7th records
Replace <your_ordering_column>
with the column by which you want to order the records. The LIMIT 3
specifies that you want to retrieve three records, and OFFSET 3
skips the first three records, starting from the 0-based position.
For example, if you want to order by the employee_id
column:
SELECT * FROM EMP ORDER BY employee_id LIMIT 3 OFFSET 3;
Adjust the column name in the ORDER BY
clause based on your specific table structure and requirements.
Related Questions
Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com
Ask a QuestionRecommended Articles
Why Should you Learn Microsoft Office
Microsoft Office is a very popular tool amongst students and C-Suite. Today, approximately 1.2 billion people across 140 countries use the office programme. It is used at home, schools and offices on a daily basis for organizing, handling and presenting data and information. Microsoft Office Suite offers programs that can...
8 Hottest IT Careers of 2014!
Whether it was the Internet Era of 90s or the Big Data Era of today, Information Technology (IT) has given birth to several lucrative career options for many. Though there will not be a “significant" increase in demand for IT professionals in 2014 as compared to 2013, a “steady” demand for IT professionals is rest assured...
Make a Career in Mobile Application Programming
Almost all of us, inside the pocket, bag or on the table have a mobile phone, out of which 90% of us have a smartphone. The technology is advancing rapidly. When it comes to mobile phones, people today want much more than just making phone calls and playing games on the go. People now want instant access to all their business...
What is Applications Engineering all about?
Applications engineering is a hot trend in the current IT market. An applications engineer is responsible for designing and application of technology products relating to various aspects of computing. To accomplish this, he/she has to work collaboratively with the company’s manufacturing, marketing, sales, and customer...
Looking for SQL Server Training?
Learn from the Best Tutors on UrbanPro
Are you a Tutor or Training Institute?
Join UrbanPro Today to find students near youThe best tutors for SQL Server Classes are on UrbanPro
The best Tutors for SQL Server Classes are on UrbanPro