search

Home  >  Q&A  >  body text

How to find the average value of specified field data in mysql

Table price, field category, value 55, average field pi

category,pi
55 100
55 105
56 130
55 95
55 80
59 115
55 101
55 98

How to calculate the average value of field pi (data with category 55)

滿天的星座滿天的星座2808 days ago897

reply all(1)I'll reply

  • 阿神

    阿神2017-05-18 10:54:53

    select avg(pi) as pi_avg from price where category=55

    reply
    0
  • Cancelreply