answersLogoWhite

0

How do you get top 2 in sql?

User Avatar

Anonymous

17y ago
Updated: 8/16/2019

SELECT * FROM table ORDER BY value DESC LIMIT 2

OR SELECT TOP 2 FROM table

User Avatar

Wiki User

17y ago

What else can I help you with?

Related Questions

Diff between sql server 2000 and sql server 2005?

Hi Everybody, I am Vijay.According 2 me the differences are: 1. In SQL Server 2000 the Query Analyzer and Enterprise Manager are seperate,whereas in SQL Server 2005 both were combined as Management Studio. 2. In Sql 2005,the new datatype XML is used,whereas in Sql 2000 there is no such datatype 3. In Sql server2000 we can create 65,535 databases,whereas in Sql server2005 2(pow(20))-1 databases can be created.


What are SQL data types used for?

There are many purposes behind 'SQL' data types. The most common use of 'SQL' is with website programming and hosting services, as well as HTML coding.


What is the Select Top clause?

The Select Top clause is a programming command used with SQL or Structured Query Language. SQL is one of the main languages used in managing databases. The Select Top clause is used to specify the number of records to return from a query on the database.


Where can one obtain SQL Compare by Red Gate Software?

One can obtain SQL Compare by Red Gate Softwares at the official Red Gate website. On the site, simply go on the "Products" tab on the top to purchase SQL Compare.


What are some typical SQL interview questions?

Some sample SQL interview questions could be the following 1. Write an SQL query to display the current date. 2. Write a SQL query to name the employees who have worked here for 5 years.


Two examples of database?

1. oracle 2. My SQL


Where could someone find an SQL formatter?

One can find an SQL formatter from: SQL Format, Free Formatter, Poor SQL, T-SQL Tidy, Stack Overflow, SQL Inform, Apex SQL, SQL Parser, Red Gate software, to name a few.


What is the difference between T-sql and sql?

T-SQL is Microsoft's version of the generic SQL langauge to be used with, for example, Microsoft SQL Server.


What has the author Jonathan Sayles written?

Jonathan Sayles has written: 'Oracle Sql*Plus for Application Developers' 'QMF' -- subject(s): Database management, IBM Database 2., QMF, SQL/DS 'SQL as a second language' 'SQL for dBASE IV' -- subject(s): DBase IV (Computer file), Database management, SQL (Computer program language) 'How to use Oracle SQL*Plus' -- subject(s): Oracle (Computer file), SQL (Computer program language)


Forms of sub queries in ms sql?

Sql Forms Sql Forms


What are two method of retrieving SQL?

1.what cursor type do you use to retrieve multiple recordsets? 2.What are two methods of retrieving SQL?


What is the meaning of top incl in sap terminology?

Content provided by Ramona Maxwell - please visit www.sqlsolver.com:TOP is a T-SQL operator that returns the top x number of rows in a query. It can be used along with a where clause, say for instance to find the TOP group WHERE the date is within a specified range. SAP is a database neutral application platform that natively uses the limited set of Open SQL commands and also supports specific SQL implementations such as Microsoft's SQL Server. Thus you could execute your Microsoft®, Oracle® or other SQL query within the SAP® environment using the EXEC SQL command, however you should debug your query first within the database management system you created it in because SAP will not provide error information to you if the query is not running correctly.