-
Produce a List of 5 Highest Revenue Transactions
You need to produce a list of the five highest revenue transactions from the Orders table in the Sales database. The Orders table is defined as follows:CREATE TABLE Orders ( OrderID Int IDENTITY NOT NULL, SalesPersonID Int NOT NULL, RegionID Int NOT NULL, OrderDate Datetime NOT NULL, OrderAmount Int NOT NULL ) Which statement will produce the report correctly?...
-
-
-
Find out nth highest salary from emp table
SELECT DISTINCT (a.sal) FROM EMP A WHERE &N = (SELECT COUNT (DISTINCT (b.sal)) FROM EMP B WHERE a.sal < = b.sal);For Eg:-Enter value for n: 2SAL---------3700
-
How you will avoid duplicating records in a query?
By using DISTINCT