sql语句中的in用法示例
SELECT TOP is used to return the number of records, it is very fast and its performance is very good. It is very useful for the large database having thousands of records.
SELECT TOP用于返回记录数,它非常快并且其性能非常好。 这对于具有数千条记录的大型数据库非常有用。
SELECT TOP is used in different ways in different databases.
SELECT TOP在不同的数据库中以不同的方式使用。
Syntax
句法
MS Access: select top number column_name from table_name;
MS Access :从table_name中选择头号column_name;
MS Access: select top percent column_name from table_name;
MS Access :从table_name中选择百分比最高的column_name;
MySQL: select column_name from table_name LIMIT number;
MySQL :从table_name LIMIT号中选择column_name;
Oracle: select column_name from table_name where ROWNUM (<=, >=, ==) number;
Oracle :从table_name中选择column_name,其中ROWNUM(<=,> =,==)号;
Example:
例:
Table 1:
表格1:
Student_ID | Student_Name | Dept | Branch | Course |
---|---|---|---|---|
15011 | Aman Gautam | CSE | IT | B.tech |
15028 | Atul Anand | CSE | CS | B.tech |
15032 | Bharti Parmar | CSE | CS | B.tech |
15068 | Partha Biswas | CSE | IT | B.tech |
学生卡 | 学生姓名 | 部门 | 科 | 课程 |
---|---|---|---|---|
15011 | 阿曼·高塔姆(Aman Gautam) | 自学考试 | 它 | 科技 |
15028 | 阿图尔·阿南德(Atul Anand) | 自学考试 | CS | 科技 |
15032 | 巴尔蒂·帕玛(Bharti Parmar) | 自学考试 | CS | 科技 |
15068 | 帕萨·比斯瓦斯(Partha Biswas) | 自学考试 | 它 | 科技 |
SQL Query using Oracle Database:
使用Oracle数据库SQL查询:
![select top](https://www.includehelp.com/sql/images/select-top.jpg)
Conclusion:
结论:
In this article, we have learned about the SELECT TOP method to retrieve data from the database. It is very useful for retrieving data from the large database. We will know more about SQL in the upcoming article.
在本文中,我们学习了用于从数据库检索数据的SELECT TOP方法 。 这对于从大型数据库中检索数据非常有用。 在下一篇文章中,我们将更多地了解SQL。
翻译自: https://www.includehelp.com/sql/select-top-with-example.aspx
sql语句中的in用法示例