top 2 places mysql

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

    #1

    top 2 places mysql

    I am trying to do a query in mysql which does:
    displays only the 'animalentry.an imal_id' and 'animal.name' where
    'animalentry.pl ace' = 1 or 2

    The tables and fields / columns are
    'animalentry' - table
    'animalevent_id ' - column / field
    'animalplace' - column / field


    'animal' - table
    'animal_id' - column / field
    'name' - column / field
    'year_born' - column / field
    'year_died' - column / field
    'animal_gender' - column / field

    I need to only display where the animal has a place = 1 or 2 and more than 3 times

    Select animalentry.ani mal_id, animal.name
    from animalentry inner join animal
    on animalentry.ani mal_id = animal.animal_i d
    where animalentry.pla ce = 1 or animalentry.pla ce = 2


    So if animal has a place = 1 or 2 more than 3 times the animalentry.ani mal_id and animal.name are displayed
Working...