Results 1 to 3 of 3

Thread: Get the name of 3rd most expense item

  1. #1
    Geek_Guest
    Guest

    Get the name of 3rd most expense item

    Question asked by visitor Steve

    What will be the query to get the name of 3rd most expense item from table Item (ID,Name,Price)?


  2. #2
    Expert Member
    Join Date
    Dec 2006
    Answers
    204

    Re: Get the name of 3rd most expense item

    The same thing is already discussed for 788th greatest in the following link:

    http://www.geekinterview.com/talk/24...st-salary.html

    I think this will help you.


  3. #3

    Re: Get the name of 3rd most expense item

    To get the 3rd most expensive item :

    Select b.price , b.Id , b.name
    from Item b, Item b
    where
    b.price <= a.price
    group by (b.price)
    having count(b.price) = 3


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact