Find the 6 highest amounts in a table in Mysql

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ozchadl
    New Member
    • Apr 2010
    • 26

    Find the 6 highest amounts in a table in Mysql

    I wish to find the 6 highest amounts in my Mysql database.
    The database name is employment
    The table name is jobs
    The columns / fields are:
    'Job title'
    'Company Name'
    'Employment dates'
    'Pay'

    The 'Pay' column / field contains only numbers such as 100

    I would like to know the 6 Highest 'Pay' amounts I received.

    Thanks for your help
  • TheServant
    Recognized Expert Top Contributor
    • Feb 2008
    • 1168

    #2
    I think you mean the table is employment?
    Code:
    SELECT JobTitle, Pay FROM employment ORDER BY Pay DESC LIMIT 6
    You should look up ORDER BY and LIMIT commands for MySQL. Also, OFFSET might be useful.

    Comment

    Working...