Bineesh  Viswanath

Bineesh Viswanath

  • NA
  • 1k
  • 777.6k

SQL Query to find second highest value

Nov 28 2013 12:17 AM
Sir, I need your help to find the second highest value related to this query.

Here I writing query to find the customerName, ProductName and  ProductPrice.

  select A.customerName,B.productName,B.unitPrice  from tbl_Customer as A
 
inner join tbl_custProductSales on A.customerId=tbl_custProductSales.customerId inner join
 tbl_Product
as B on B.productId=tbl_custProductSales.productId

Like this I want to get the second highest productPrice, customer and productName

My result would be:

customer     product      second_highest_productRate
-----------------------------------------------------


Answers (2)